Ways to change website domain names on WordPress
Whether it is to find a better new domain name or an existing domain name for temporary use, if you do not know how to change a new domain for a website on WordPress, this is the way for you. Note that before changing, you will need to take some action to ensure the security of the posted content.
Prepare the necessary information
Before renaming the website domain, you need to have the following information:
- WordPress login information including username (or email) and password.
- Login information cPanel or file manager.
- FTP login information.
- Access to PHPmyAdmin on the control panel.
Don't forget to back up all settings on WordPress. Here are 4 ways to change domain names for WordPress websites. The first two ways will be easier, if not effective, then the second way.
1. Change domain names on the admin panel of WordPress
This is the simplest way to change domain names for your WordPress website. Just log in to your WordPress account, then go to the General Settings page , you will see two options: WordPress Address (URL) and Site Address (URL).
Change these two URLs to the domain you want, in most cases they will be the same. But they will be different if you store WordPress files on a different directory than the domain used to access the site. In that case, WordPress Address is the directory where the WordPress file is stored, and Site Address is the address that others use to find your site.
If you can access the admin panel, this will work, otherwise try the second method.
2. Edit the database via PHPmyAdmin
Before editing, remember to back up on cPanel or any other control panel you are using. Go to PHPmyAdmin and find WordPress data in the left column. Click to select, you will see the list of tables appear under the name of the database. Find the table named wp_options and click on it. This table contains 2 lines that you need to fix: siteurl and home. Now edit the domain you want to use.
3. Edit wp-config.php file
If the above two methods don't work, fix the wp-config.php file directly. You can edit this file inside the file manager or download it to fix it and upload it to the FTP Client. Please correct the two lines of code that define the website URL as shown below.
Replace example.com with the domain name you want to change. This way will change the domain but should only choose when other ways are not possible. When manually editing the wp-config.php file , you have changed the page value on the website and cannot edit these values using the General Settings section of the admin panel.
4. Edit the functions.php file to update the database
This is only a temporary command and should not be used as a long-term solution. Use this method only when all of the above methods are ineffective or you cannot access the website via the front-end. Please add the following two lines of code after the line "
Then upload the edited file to the page and log in to the admin page several times. This operation will update the database. When the page has accepted changes, delete these 2 lines of code from the functions.php file and the database will still update the previous state.
If the WordPress theme does not have the functions.php file, you can create it yourself by wrapping the above two lines of code into the tag php tags as below.
Save the above code as text file and upload to the theme's main directory. Then log in to the admin panel several times and remember to delete this file after the database has been updated.
You should read it
- Learn about .io domain names
- How to install WordPress locally on ServerPress
- How to choose the best domain name?
- Famous websites have changed domain names before 'being successful'
- Instructions on how to check .vn domain name on VNNIC
- Turn on / off concurrent connections to both Non-domain network and Domain on Windows 10
- Anyone can now register a .app domain with HTTPS integration
- How to change DNS Quad9 to block malicious domain
May be interested
- Learn about .io domain names.io is a domain name chosen by many technology companies and startups.
- 5 mistakes everyone mistakenly thinks about WordPresswordpress has developed much beyond the original feature as a platform for bloggers.
- Why is WordPress free?today's article will discuss why wordpress is free, the cost of running a wordpress website and what users get from a wordpress site?
- 3 Easy Methods To Customize Your WordPress Site With CSScss styling allows you to edit the colors, spacing, fonts, layout, and basically every other visual element of a wordpress site
- Anyone can create a small and simple website with these 10 websiteswordpress is not the only way to create a website, there are some other great services that will prove to you. a solid wordpress platform continues to be one of the top choices for creating a website. however, in some cases, wordpress is a bit too much for new people.
- Stories behind .unicorn, .ninja and other strange domain namesone of the information you see most in the process of using the internet is the domain name.
- How to change the font in WordPressonce you have successfully installed and set up wordpress on localhost, you realize one thing: wordpress's default font when typing vietnamese does not look good, it is not beautiful when using large font size, or zoom in. .. or simply, we want to change the default font of wordpress, how to do it?
- How to choose the best domain name?domain name is the first thing that impresses your website visitors. because they will see it first when browsing the web, so it needs to send the right message and show professionalism.
- Instructions on how to check website lifethe following article will introduce and guide you how to check the time that a website is available on the internet in a simple and specific way.
- How to check website IP address / domain namehere are 3 simple and effective ways to easily check your website / domain ip address, you can do it on both computer and phone.