How To Change The Domain of a WordPress Site? Change Site URL WordPress:

Change The Domain of a WordPress Site

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.

change site url wordpress

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:-

define(‘WP-HOME’, ‘http://example.com’);

define(‘WP_SITEURL’, ‘http://example.com’);

change site url wordpress database

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.

by Ravi Chahar

A blogger, web developer, and designer who intend to guide his readers about WordPress, Blogging, Web Development, Web Design and more. I have expertise in WordPress theme development and customization. I can set up and redesign the Thesis themes. I have been working in this field for years now.

2 comments

  1. Hi Ravi,

    The most important and first decision before building website is choosing a domain name.
    A website’s success depends very much on domain because it affects SEO,SMM and many more factors.
    The domain of Website makes your website unique and Builds a Brand Image; there is no doubt at that.
    It occurs many times to change the domain due to better Url or rebrand strategy.
    It is better to follow some strategies otherwise it will result in losing readers, affecting SEO and loosing good links.
    Your tips are profitable to follow and help maintaining the influencers of previous domain and many more.
    Thanks for sharing with us.
    With regards,
    Saurav

    1. Hey Saurav,

      You are right. The domain name of your website shows the significance of your business. There are many bloggers who don’t keep it in their mind while buying the domain name.

      Some people prefer to change the domain name of their website. But, they forget to change the URL which results in the broken links and the loss of traffic.

      It’s good to know that you found the tips helpful.
      Have a great day.
      ~Ravi

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge