How to Change Domain Name in WordPress Without Hurting SEO

Change Domain Name WordPress

Saif Hassan July 11, 2019

12 Min Read
4
Category: Tutorials
Before sharing this – I want to share a story. Back in 2009, I was using a free .co.cc domain. (free domain – so why not?) After using about a year and having some great traffic (avg 2k unique/day) – I had to change the domain since .co.cc was shutting domain. Since I did not know much I simply changed the domain. After a week, I got hundreds of error messages in Webmasters Tools (aka Search Console now). When I investigated the issue I found out that my traffic dropped to almost 100 – almost 2000% decrease!
changing-wordpress-domain
 
I investigated more and found out that it was happening as I did not do a proper 301 redirect of my old URLs. I know it has been some time but I tried to write down all the things that you should do before changing the domain of your WordPress website.

Finding an ideal domain name for your website can be tricky. After hours of research, you may find your perfect domain name. Now, you are all set to start your WordPress website.

But what if you realize it’s not the right domain for your website? What if you feel an urgency to change the domain name of your WordPress site? You could be facing issues with your branding. Or you could just give yourself a fresh start.

Changing the domain name is always an option, but the task is a little bit complex. Moreover, changing your domain name could wash away all the hard work you had done for your website’s SEO.

You might be wondering if there’s a way to change the domain name while keeping all the SEO benefits. Yes, there is.

In this article, I will explain to you how you can change your domain name while keeping the SEO benefits.

Before proceeding further, let’s have a look at a few points to keep in consideration when you change the domain name on a WordPress website

  1. Do not change the URL structure of your website. If you make too frequent changes in the permalinks of your site, it will have adverse effects on the SEO of your website. You can read more about the best WordPress permalink structure.
Best WordPress Permalink Structure
  1. Expect a dip in your traffic for the first few days or a maybe a week or so. The reason being all your new posts and pages will be crawled under a different name which will initially have low domain authority.
  2. Make sure to use a more secure HTTPS connection instead of the HTTP connection. According to the latest algorithms, search engines give an edge to the websites having an HTTPS connection over a site with HTTP connection.

I am saying it loud and clear again – HTTPS connection is mandatory in 2024. There’s absolutely no reason to use HTTP anymore.  You can read our tutorial on

I am assuming you have already bought your new domain and you have access to change the domain’s name server.

1. Back up your website’s content

Backing up all the existing content of your website will prove beneficial for you while changing the domain name of your website if anything goes wrong. There are several ways to back up your web site’s content, such as using WordPress plugins or backing up the content manually.

Read the following article on the WordPress database backup to set up WordPress database backups automatically.

After backing up all the content from the existing website, you can either transfer all the data into a new website with your new website address or update the existing web address. If you opt for the latter part, your current WordPress website’s dashboard will be accessible through your new website address.

2. Move Your WordPress Website To The New Domain

Go to Settings >> General 

Change Domain Name WordPress
  1. Update your new domain’s nameserver with appropriate ones. Read our in-depth article on changing domain nameserver.
  2. Now once, you change your current website’s domain name and hit “Save” your website might not be available at the new domain name instantly. 

It usually takes some time (2/3 hours) to propagate the change worldwide.

2. Updating Links of your website

After you have successfully updated the new domain name in your web address, the next step is to update all the interlinks related to the older domain name. Replace all the links such as CSS, Javascript, or maybe the links of your content with the help of WordPress plugins or using the command line interface of WordPress. One such plugin is Better Search and Replace. The plugin works really well.

  1. Install the plugin Better Search and Replace
  2. Write your old website URL in the “Search for” text field and write your new website URL with https:// in the “Replace with” text field. 
    Domain Change WordPress
  3. Select all the tables by pressing Ctrl+A
  4. Uncheck “Run as dry run”
  5. Check “Replace GUIDs”.
  6. Click Run Search/Replace

3. Adding 301 Redirecting links

After updating all the internal links of your website, the next step is arguably the most crucial step in changing your WordPress website’s domain name. Add the 301 redirect links; it means directing the traffic from your previous domain name to your new domain name.

If you forget to this step, you will eventually lose all the backlinks associated with your website. This will put a negative impact on the SEO of your website. Moreover, if the visitors will click on the previous links of the website, it will lead them to nothing hence creating broken links, generating 404 pages.

Google takes 404 Errors very seriously. If users experience too many 404 errors – Google will punish you.

You can add 301 redirect links either by adding them at the server level via htaccess or the host level. Another way to add 301 redirect links is with the help of Cloudflare. If you don’t use Cloudflare already, you should.  You can add free SSL and improve pagespeed using Cloudflare

  • Create a Page Rule where every URL that matches *domain1.com/* is 301-redirected to https://domain2.com You can do this via the page rules inside Cloudflare.  The added rule could look like this
How to Change Domain Name in WordPress Without Hurting SEO 3

4. Update Your Website in Google Webmasters Tools & Google Analytics

Google Search Engine Console is the new version of Google Webmasters Tools. After shifting your website to a new website domain name, you will need to send Google a request to change the address of your previous domain. This way, Google will know that you have changed your domain and will give you SEO benefits

Change Domain WordPress

Also, while you are at it, if you use the Google Analytics tool to analyze your website’s performance, make sure to update site address on it too.

The same thing has to be done in Google Analytics.

Change the Domain Name of Your Google Analytics Property

Step 1: Go to https://analytics.google.com and navigate to your existing analytics property.

Select-the-Correct-Propery


Step 2: Click on the Admin label in the main menu.

Admin Settings Analytics


Step 3: In the middle column, click Property Settings.

Select-Property-Settings


Step 4: Change your Analytics Property Name and your Default URL.

How to Change Domain Name in WordPress Without Hurting SEO 4


Step 5: Click save.

5. Submit New Sitemap

After submitting your website change request, you need to submit your new domain’s sitemap Google Search Console.

Here’s a video of how to submit your sitemap to Google.

Having a sitemap will give you more SEO benefits. [Know more about WordPress SEO here] you need to update the sitemap of your site too. A sitemap will help your website to get crawled faster.

6. Updating Miscellaneous Files

After the change of your WP domain, it’s time to pay attention to smaller details. Update the information in all the software and plugins associated with your site. And, make sure to keep the number of pages with error 404 to as minimal as possible.

Make sure you replace all of your old links with the new domain using Better Search & Replace. The plugin works remarkably well.

Domain Change WordPress

Concluding Thoughts

Following the steps mentioned earlier, you can easily change the WordPress domain name of your WordPress website without harming the SEO of your website. Although we would suggest not to change domain name unless it’s absolutely necessary.

Wordpress Icon

Disclosure: WP Hive earns a commission when you buy through partner links. It does not influence the unbiased opinions of our writers. Learn more →

Share:

https://wphive.com/tutorials/change-domain-name-wordpress/Copy icon

Saif Hassan

Product Manager by passion & profession. Lead Product Manager at weDevs, former PM @ Poptin. Passionate about writing & tech. He's an advocate of Human-Centered Design and believes that websites and the tools used to build them should be well crafted, intuitive, and accessible. Cyclist. Reader. A WordPress ninja 🥷, HCI expert & a design thinker 💡

Subscribe To Our Newsletter

Newsletter Subscription Form

4 Comments

Toufiq Hassan Shawon

Replacing guID is necessary with better search replace, if you want to change the domain name. Otherwise in gu ID field of the database the old domain still remain.

If you change the hosting, you need to replace the hosting path also.

And what about other analytics integration and tracking code change?

Hi there! This post could not be written any better! Reading through this article reminds me of my previous roommate! He constantly kept preaching about this. I am going to forward this post to him. Pretty sure he’s going to have a great read. Thank you for sharing!