How To Change The Domain of a WordPress Site? Change Site URL WordPress:
July 9th, 2016 | by Ravi Chahar || 2 Comments |
After moving your website to another domain name, you have to take care of many essential things. Do you know how to change the domain of a WordPress site? Well, after changing the domain name you should change site URL in WordPress. There are the different way to accomplish this activity.
If you can log in to the WordPress admin panel then there is a simple way to change the URL. What if you are locked out of your admin panel? In such situation, many other ways are there. You can use the cPanel of your web hosting account. You have to search for the files present in your website’s directory and modify them.
Different ways to change site URL in WordPress.
I am going to mention three ways to change site URL WordPress. You just have to know which method is helpful in which condition. You may have heard that people are not able to log in their WordPress admin panel. And if you are able to log in your admin panel then you can change the site URL from the admin area only.
Let me show you all the three ways:-
1. When you have the authority to login in your admin area then you can change the site URL by going to the settings>> general and the box to fill the WordPress URL and the site URL. you have to fill both the URL. The WordPress URL is the URL where all the core files of your WordPress website are located.
The site URL is the URL using which all the people can reach to your website. It’s the domain name of your website. Though in the WordPress URL, you can fill the site URL. So don’t worry about it and fill the URL of your website in both the sections.
2. When you can’t enter in the admin panel of your website then you should use the cPanel of your website. There are many core files located in your website’s directory from which you have to find out the “wp-config.php” file. Just click to edit the file and two lines of the code are needed to add. After adding the code, save the file and your mission to change site URL WordPress will be accomplished. The code is:-
Though there are many files in the directory but still, you won’t face any difficulty in finding the “wp-config.php” file. Always remember, never edit any core file of your website without having the backup of that file. It’s always recommended to have the backup of your website and the database on your hard drive. The backup includes all the core file of your website.
3. Change site URL WordPress database:- You can change the URL of the site from the database. There is nothing to fear about editing the database. Just keep the backup of the database. In case, anything goes wrong, you can upload the database again to the server.
- You can do that by using the phpMyAdmin from where you can choose the database of your website.
- After that search for the table “”wp_options”.
- Click on the edit option in front of the “siteurl” entry or the home row.
- fill the new URL under the option_value
- click on the save button
You have successfully changed the site URL. All the images of your old domain will redirect to your new domain and you won’t see any blank space on your website.
Have you used cPanel method to change site URL database edit option?
The first option is available when you can log in to your WordPress admin panel. But if you can’t do that or the wp-admin page keeps refreshing then you should use the cPanel. Now is the choice for you. You can edit the “wp-config.php” file or deal with the long process with the database.
In my opinion, the file editing option is the best one. You don’t have any risk to break the database. Just add two lines and you are done. If you still face the problem then you can do it by relocation.