It’s always scary to migrate your WordPress site. But it’s doubly worrisome when you throw changing your domain name into the mix. You put all that time and effort into building your site’s SEO ranking. Now, you’re naturally worried about throwing it all away when you switch to your new domain name.

But, you really don’t need to worry…that much. Google knows people need to switch domain names sometimes, so they’ve made it fairly simple to maintain your SEO ranking as long as you follow the right steps. And that’s what this guide will show you how to do:

Migrate your site to a new domain name without losing your SEO ranking.

Why Would Someone Change Domain Names, Anyway?

Whenever possible, it’s definitely better to stick with your existing domain name. But there are some scenarios in which a switch is beneficial (or downright necessary):

  1. You get access to a domain name that is infinitely better than your current one. Sometimes this happens because the old owner lets their registration lapse. Or sometimes it happens because your site was so successful that you can afford to purchase a premium domain name.
  2. Your domain name gets penalized. Hopefully this never happens to you. But if it does, switching is one way to get out of the penalty.
  3. You rebrand intentionally. Sometimes companies or individuals need to rebrand for a variety of reasons. Switching domains is an essential part of this.

With that out of the way, let’s dig into the actual process of moving your content to a new domain while preserving your SEO rankings.

Three Important Notes Before Beginning

First, these tips are all about avoiding a major, permanent loss in SEO ranking. Your site will likely experience a temporary dip during the migration process. This is largely unavoidable. But if you follow the process correctly, you should minimize this loss and be back at your original search positions as soon as possible.

Second, I’ll assume that you have a backup of your site. Keep a clean backup somewhere in case something goes wrong with the migration. If you’re not sure how to do that, read this guide to backing up WordPress.

Third, you will still need to maintain ownership of your old domain name, even if you no longer use it for your site. This is essential to ensure that the redirects you add in this guide continue to function forever.

Step 1: Copy Your Existing Site and All Content to Your New Domain

Before you start redirecting anything, you need to create an exact copy of your site at your new domain. You can use the Duplicator plugin to easily duplicate your existing WordPress site.

While you can also do this migration manually, I definitely recommend using Duplicator. Here’s why.

Duplicator includes an option to update all of your existing URLs to your new domain. When you migrate manually, you can update the URL in the WordPress dashboard, but that won’t update all the internal links you’ve used in posts or pages. Duplicator will automatically update all of these internal links, which makes the process much simpler:

SEO Ranking - Duplicator

If you use a method other than Duplicator to move your site, you can automatically update all your internal links by using the Velvet Blues Update URLs plugin. It’s not difficult – it just adds an extra step to the process.

Velvet Blues

Once your site is set up on your new domain with all the proper internal links, you should browse through it and make sure everything is functioning properly. Make sure the links work and there aren’t any broken images.

In the next step, you will redirect all traffic from your old site to your new site. Your new site needs to be 100% ready to handle this live traffic.

Step 2: 301 Redirect Your Old Site to Your New Site

Now’s the somewhat tricky part. You need to 301 redirect your old site to your new site so that both humans and search engine robots can find the correct page.

Why 301 redirect? Because a 301 redirect tells browsers and search engines that the page has moved permanently. This is essential so that Google and other search engines know to pass the same “link juice” to your new pages as your old pages.

You’ll need to find your .htaccess file. To do that, you need to use an FTP program to access your WordPress site’s server. The .htaccess file will be in the root folder of your site – the same one which includes important documents like wp-config.php and your wp-admin folder.

Download this file and make a copy of it. Keep the original untouched. This is another backup in case anything goes wrong with your redirects.

Once you have a backup copy safely secured, open the .htaccess file with notepad or another text editor. If you’re using pretty permalinks, you should see code added by WordPress that looks something like this:

htaccess

Don’t worry if you see more code than my screenshot – some plugins may have added additional rules. That’s not a problem.

Adding a 301 Redirect

Now, you need to add your 301 redirect code to the top of your .htaccess file.

The 301 redirect code you use will depend on whether or not you’re planning to keep the exact same URL structure on your new site.

Use this code if you’re planning to use the same URL structure. That is, “olddomain.com/posts/cool-post” will be “newdomain.com/posts/cool-post”:

RewriteEngine on  RewriteCond %{HTTP_HOST} ^oldurl.com [NC,OR]  RewriteCond %{HTTP_HOST} ^www.oldurl.com [NC]  RewriteRule ^(.*)$ http://newurl.com/$1 [L,R=301,NC]

Where “oldurl.com” is the URL of your original domain name and “newurl.com” is the URL of your new domain name.

If you’re planning to change the URL structure, you’ll need to manually redirect every single link on your site. That is time-consuming and…not fun. But, it is most definitely necessary. Here’s the code you’ll need to use for every single post and page:

Redirect 301 /original-post http://newdomain.com/cool-new-post

Where “/original-post” is only the part of the URL which comes after “olddomain.com” and “http://newdomain.com/cool-new-post” is the full URL of the post on your new site.

Once you save and upload the new version of your .htaccess file, all traffic to your old site should be redirected to the corresponding URLs on your new site. You should do some manual testing to ensure these redirects are functioning properly.

After your manual tests are successful, you should also use the Fetch as Google tool in the Google Search Console to make sure Google is being properly redirected to your new site:

Fetch as Google

Step 3: Tell Google You Changed Your Domain Name

Now that you’re sending all traffic to your new domain name, you should tell Google about the change. While Google will eventually figure out the change no matter what, filling out their official form makes the transition easier and helps ensure that you don’t lose your SEO rankings.

To do this, you need to go to the Search Console (previously known as Webmaster Tools).

If you haven’t verified your old domain in the Google Search Console, you’ll need to do that first (here’s how to verify a site in Google Search Console).

Once your old site is verified, you also need to verify your new site by following the same process. It’s essential that both sites are properly registered in the Google Search Console.

Once both sites are verified, you can fill out the Change of Address form by clicking on the gear icon in the top right of the dashboard for your old domain name:

Change of Address

Follow the instructions on the form completely and then click the Submit button:

migrate-site-without-losing-seo-ranking-5-google-change-address

Step 4: Submit a New Sitemap

After telling Google about your change of address, it’s also a good idea to submit a sitemap for your new domain name.

To do that, you first need to create an XML sitemap for your new site. Then, you need to submit that sitemap to the Google Search Console. Because you should have already verified your site if you’re following the guide properly, all you need to do is click Crawl → Sitemaps → Add/Test Sitemap:

Update Sitemap

Step 5: Monitor the Google Search Console for Any Issues

Because you just made some pretty major changes to your site, it’s a good idea to keep an eye on the Google Search Console for any indexing issues Google runs into.

Check reports like index count, crawl errors, and search queries to make sure your new site is getting indexed and crawled correctly. Google has a full list of everything to check in this help article.

You should also be on the lookout for any messages from Google inside the Search Console.

Step 6: Update As Many Inbound Links as Possible

Now is a good time to reach out to the sites linking to you and ask them to update their links to your new domain name. You probably won’t be able to get everyone to update their links. But it’s a big win even if you only get some of these inbound links updated.

Of course, the 301 redirect will still redirect people who use your old domain. But it’s always cleaner and better user experience for users to go straight to the linked domain.

You should also make sure to update all of your own properties – think of every social network or profile page you have. They all need to be updated to your new URL.

Step 7: Notify Users About Your Move

This might not have a direct effect on your SEO ranking, but it’s important for readers to know about your domain switch. This eliminates confusion and ensures they link to the proper URL in the future.

There are two ways that you can do this:

  1. Write a post on your new site explaining the change.
  2. Create a custom 404 error page for your new site to catch people who may have clicked on an improperly redirected link.

I recommend doing both.

Step 8: Monitor, Wait, and Feel Accomplished

You’ve now done everything possible to minimize the impact of a domain change on your SEO ranking. All you can do now is wait for Google to fully index your new site and move it up in the rankings.

You will likely experience a temporary drop. But, if you did everything properly, this drop should be just that:

Temporary.

Wrapping Up

Hopefully you found this tutorial helpful! It can be scary moving everything to a new domain and our goal is to help make that process as pain free and anxiety free as possible. We’d also like to encourage those who have made the switch successfully to chime in below.

Have you successfully moved your WordPress site to a new domain without losing your SEO ranking? It would be awesome if you shared your experience in the comments.

Article thumbnail image by Bloomicon / shutterstock.com

The post How to Protect Your SEO Rankings When Migrating Content to a New Domain appeared first on Elegant Themes Blog.

Powered by WPeMatico