How to migrate your WordPress website to another domain without impacting SEO

Changing your domain name is a big deal and something not to be done lightly. Yet it’s an essential part of any rebrand or business name change.

While it may seem complicated on the surface, migrating a WordPress website to another domain is actually very straightforward.

The trick is to do it without impacting any SEO goodness you have gained over your time so far.

We’re going to show you how to migrate your WordPress website to another domain, set up redirects so your SEO isn’t impacted too much and test if everything works okay.

We’ll share how to place 301 redirects so visitors are sent to your new domain and how to check for any broken links.

Everything you need for a successful website migration!

Why migrate a website to a new domain?

Why migrate a website to a new domain? We covered a prime reason in the introduction but there are a few other motives for migrating.

They include:

Rebranding the business – If you’re rebranding your business, your website needs to reflect your new identity. Migrating domains enables you to do that without having to rebuild.

Better domain name – Let’s be honest, all the good domain names have gone. If you have managed to buy the perfect name from an auction or expired domain reseller, that’s another good reason to migrate.

Move your hosting to your domain name provider – Operationally, it makes very little difference if you have your domain name registered somewhere different to your web host. However, having the two together does make managing them easier.

We’re sure you can think of other reasons why you might want to migrate your WordPress website to another domain, but you get the idea!

Remember, this guide is about migrating to a new domain, not a new web host. That’s a whole other guide!

Before you migrate your WordPress website

There’s a couple of things you should be aware of when changing a domain.

You will need to create a database for it to work. We will walk you through the whole process but it’s important to know beforehand that you’ll need to follow the process carefully.

You will also need to edit your .htaccess file. Again, we’ll walk you through everything but it’s important you know what’s coming.

You will lose a little SEO during the process. Even though we minimize losses with permanent redirects, you will see an initial dip in visitors and ranking. This will recover in time but it’s something you need to know.

How to migrate your WordPress website to another domain

Before we get to the actual migration process, you have to decide what method you’re going to use.

Manual or automatic migration?

There are two main types of migration:

Plugin migration – Plugin, or automatic, migration requires much less work as the plugin does all the work for you. It provides less control over the process as a result though.

Manual migration – Requires more work from you but provides complete control over what is migrated.

As this is a complete guide, we’ll show you both. However, on balance, we would recommend the plugin migration method to all but the most experienced WordPress users.

How to migrate your WordPress website to another domain using a plugin

As we recommend this method for the majority of users, let’s cover the plugin method first.

We will:

  • Take a full backup of your WordPress website
  • Create a database for your new domain
  • Use the Duplicator WordPress plugin
  • Add a permanent 301 redirect to your old domain
  • Tell Google about the move
  • Test all links to ensure none are broken

You will need the cPanel or dashboard login for your web host or an FTP client like FileZilla to make this work.

Let’s get started!

Create a backup of your WordPress website

First thing’s first. Let’s take a full backup of your website so if anything happens, you’re covered.

The Duplicator plugin is pretty good at what it does and shouldn’t lose any files but it’s better safe than sorry!

  1. Select Duplicator from the left menu of your WordPress dashboard
  2. Select the Create New button at the top right
  3. Select the blue Next button on the next screen and wait for the scan to complete
  4. Select the blue Build button if you see all green and allow the process to complete
  5. Select One-Click Download on the final screen to download the backup to your computer

Once complete, you will have a full copy of your website including theme files, plugins, uploads, permalinks and all the other files you need to rebuild.

Create the WordPress database for your new domain name

Creating the database is the most involved part of the process, but if you follow our instructions carefully, you’ll be fine.

You will need the login details for your web host for this part.

  1. Log into your cPanel or web host’s control panel
  2. Select MySQL Databases from the Database section
  3. Enter a meaningful name in the box under New Database
  4. Select the Create Database button
  5. Go back to the MySQL Databases screen and scroll down to MySQL Users

  1. Create a new database user in the Add New User section. Make sure to record the name and password
  2. Scroll down to Add User to Database

  1. Select the user you just created by the User box
  2. Select the new database you created by the Database box
  3. Select the Add button underneath

Make sure to keep a record of the database name, the user and the password as we’ll need it later.

Migrate to your new domain name

Now it’s time to migrate your WordPress website to your new domain name.

This depends on you having already linked the domain with your hosting. As different web hosts handle this in different ways, we cannot help you with that here.

If in doubt, check with your hosting company and follow their instructions.

You should end up with a folder with the same name as your new domain on your web host.

We use cPanel here but you can use FTP if you prefer.

  1. Log into your web host and open cPanel
  2. Check the folder list on the left for the folder with your new domain
  3. Select that folder and select Upload at the top of the screen
  4. Select the Installer and Archive files created with Duplicator and downloaded earlier
  5. Upload those files to your domain folder
  6. Navigate to ‘https://www.yournewdomain.com/installer.php. Change ‘yournewdomain’ to whatever your new domain name is
  7. You should see a new Duplicator screen that says ‘Step 1 of 4: Deployment
  8. Select the blue Next button to get started
  9. Enter the database information at the next screen. Enter your new database name, use ‘localhost’ as the Host and add your new user details you created earlier
  10. Check all the information to make sure it’s 100% correct then hit the blue Next button
  11. Check the details in the next screen that appears after files have been loaded and select the blue Next button
  12. Select the blue Admin Login button to log into your new domain

Everything should be set up and you should see the familiar WordPress dashboard with all your plugins, pages and posts, just like it was.

  1. Navigate to Settings > General in your WordPress dashboard
  2. Change the WordPress Address (URL) and Site Address (URL) to reflect your new domain
  3. Select Save changes at the bottom to commit the change

Adding permanent redirects for SEO

Adding permanent redirects to your old domain tells search engines you have moved rather than gone offline. It also tells search engines to send users to your new domain name and begin building back your SEO under your new name.

As we mentioned up top, you will lose a little visibility and a few places in the search engine results page (SERPS), but that loss should be temporary.

Here’s how to add permanent (301) redirects to minimize any SEO losses:

  1. Log into your old domain folder using cPanel (or FTP if you prefer)
  2. Select your .htacess file
  3. Right click it and select Edit
  4. Paste the following code into it and save
    • #Options +FollowSymLinks
    • RewriteEngine on
    • RewriteRule ^(.*)$ http://www.newdomainname.com/$1 [R=301,L]
  5. Change where you see ‘newdomainname’ to your new domain before saving.

The code tells search engines to redirect visitors from your old domain to your new one and do the same for SEO.

Tell Google you have moved domain

Next, you need to tell Google you changed your domain.

This ensures Google begins crawling and indexing your website at your new domain and doesn’t think you have disappeared.

As moving domains is a relatively common occurrence, Google has a specific change of address tool within the Search Console.

  1. Make sure your 301 redirects are in place
  2. Visit the Google Change of Address tool here.
  3. Select the website you’re changing address for where you see ‘Search property’ on the left
  4. Select the dropdown box in the Update Google (recommended) section and select Add property
  5. Enter the URL of your new domain into the box and select the Validate & Update button

Google will perform a few checks to ensure the new domain is legitimate and works properly and will then show you a simple wizard to complete the final steps.

Almost there!

There’s just one final step to take and that’s checking for broken links.

Check your website for broken links

The backup and migrate function should have kept all links intact and the 301 redirect we added to .htaccess should ensure all your links work.

But we don’t want to leave it to chance. So, your final step is to check for any broken links.

It’s good housekeeping anyway so now is as good a time as any.

  1. Visit this website
  2. Enter your URL into the box and add the security code
  3. Select the ‘Find broken links now!’ button

The web app will check your website for any broken links and will highlight them underneath the button.

You now need to visit each page or post listed and check and change the suspected broken link.

Now you’re really done!

Now you can safely tell customers, friends, family and the wider world of your domain name change.

How to migrate your WordPress website to another domain manually

The manual migration process takes a little more time and requires more effort but gives you much better control over what happens.

We will:

  • Take a full backup of your WordPress website
  • Export and reconfigure your WordPress database
  • Copy your files to your new domain folder
  • Configure database with the new name
  • Configure WordPress with the new name
  • Set up 301 redirects to your new domain
  • Tell Google you have moved
  • Check your website for broken links

Take a full backup of your WordPress website

As we’re messing around with your website, it makes sense to take a full backup of it.

As we have already outlined the process above, use those instructions to take a backup with the Duplicator plugin or your backup app of choice.

Export your WordPress database

As you’re just moving domain and not web hosting, you don’t need to export your database. However, it might be useful to have a full copy of your database so treat this as an optional step.

  1. Log into your web host and access their cPanel or alternative
  2. Select Databases and phpMyAdmin
  3. Select your database from the left and select Export from the top tab
  4. Select Go on the next screen as the default settings are fine
  5. Save the SQL file somewhere safe on your computer

Copy your files to your new domain folder

You can use your favorite FTP program or cPanel File Manager for the next step, it’s entirely up to you.

We’ll use cPanel’s File Manager as it’s easier.

  1. Select your old domain directory in the left menu
  2. Select the Select All option at the top
  3. Select Compress at the top and select Zip Archive as the option
  4. Select Compress Files
  5. Select the new .zip folder and select Download
  6. Select your new domain folder in the left menu of cPanel File Manager
  7. Select Upload at the top and allow the process to complete
  8. Select the .zip folder in the directory and select Extract

File Manager should extract all the files and your new domain folder should look identical to your old domain.

Configure your WordPress database with the new name

Next, we need to change a couple of entries in your WordPress database in order for it to recognize your new domain name.

  1. Select Databases and phpMyAdmin in cPanel
  2. Select your database from the left
  3. Search for ‘siteurl’ in the database and change the old domain to the new one
  4. Save the change
  5. Search for ‘home’ in the database and change the old domain to the new one
  6. Save the change

That’s it. As long as you enter your URLs correctly, the database should now work with your new domain name.

You can also use the following in SQL to change the setting automatically.

UPDATE wp_options SET option_value = replace(option_value, ‘oldurl.com’, ‘newurl.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;UPDATE wp_posts SET guid = replace(guid, ‘oldurl.com’,’newurl.com’);UPDATE wp_posts SET post_content = replace(post_content, ‘oldurl.com’, ‘newurl.com’);

UPDATE wp_postmeta SET meta_value = replace(meta_value,’oldurl.com’,’newurl.com’);

Change every instance of ‘oldurl’ with your old domain and ‘newurl’ with your new domain.

Configure WordPress with the new name

Next, we need to configure your WordPress wp-config file to reflect your new name.

  1. Select the wp-config file from your new domain folder in cPanel’s File Manager
  2. Right click and select Edit
  3. Change ‘define(‘WP_SITEURL’, ‘https://www.oldddomain.com’);’ to your new domain name
  4. Change ‘define(‘WP_HOME’, ‘https://www. oldddomain.com’);’ to your new domain name
  5. Save your changes
  6. Log into your WordPress dashboard using the new domain name
  7. Navigate to Settings > General
  8. Change the WordPress Address (URL) and Site Address (URL) to reflect your new domain
  9. Select Save changes at the bottom to commit the change

Now WordPress matches the database and both should reflect your new domain.

Set up 301 redirects to your new domain

Follow the procedure outlined earlier to add a permanent redirect to your .htaccess file.

This will ensure all future visitors are redirected to your new address and Google knows you have moved.

Tell Google you have moved

The 301 redirects will tell Google your website has moved but it’s also good practice to update the change in Google Search Console.

Follow the steps from earlier to update everything.

Check your website for broken links

Finally, we recommend following the same steps to check for broken links and update them all to ensure your site visitors enjoy a faultless experience.

Follow the process from earlier to check all internal and external links.

Migrating a WordPress website to a new domain

While it may seem like a lot of work, the process of migrating to a new domain is relatively straightforward.

As long as you’re careful and methodical, and you follow this guide, you should be able to complete the process in less than an hour and have a fully operational website at the end of it.

It doesn’t matter what method you use as you end up in the same place but we consider using a WordPress plugin to be the simplest route to a new domain.

Have you migrated WordPress domains recently? Have any tips to share? Tell us about your experience in the comments.

FURTHER READING