Need to move WordPress to a new domain name? Maybe it’s time for a rebrand, or maybe you snagged a premium domain name that’s just too good not to use. Whatever your reasons, it’s important you do things right if you want to keep your site running smoothly.
See, the actual process to move WordPress to a new domain is fairly simple. You basically just need to copy your files to a new folder on your host and update your database.
But keeping your SEO rankings when you move WordPress to a new domain name takes some care. To that end, I’m going to show you both parts of the process in this post. That is, you’ll learn exactly how to:
- Move WordPress to a new domain
- Implement the proper redirects to keep your SEO rankings
Let’s start with the first part.
PART 1: How to move WordPress to a new domain name
For the first part of this tutorial, I’m not going to go especially in-depth because many of the steps are identical to our tutorial for migrating WordPress to a new host. If at any point during the next few steps you find yourself lost, it’s a good idea to consult that article for more information.
At a high level, you just need to use the Duplicator plugin to move your site’s files to your new domain. For that reason, the process is pretty much identical no matter whether you’re sticking with the same host or moving to a new WordPress host.
Here’s how to do it:
Step 1: Install Duplicator and create a package
As always, make sure you back up your site before beginning this process.
Then, get started by installing and activating Duplicator. Once it’s activated, head to the Duplicator link in your dashboard sidebar and create a new package:
Move through the package creation process and Build your package. You don’t need to change any of the default settings:
Duplicator will build your package, which consists of two files:
You need to download both files. Remember where you save them because you’ll need them soon.
Step 2: Create a new MySQL database for your site
Next, you need to create a MySQL database for your new domain. Head to cPanel and find the MySQL Databases option.
Then, create a new database:
And then a new database user:
You need to add that database user to the database you just created:
And make sure to give it All Privileges:
And that’s it! Keep the database name, username, and password handy. Because you’ll also need them in a second.
Step 3: Upload the installer and the archive files to your new domain
Remember those two files you downloaded in step 1? Now, you need to upload them to the root folder for your new domain name.
The quickest way to do this is using File Manager. To open File Manager, find its icon on cPanel and make sure to choose your new domain name for the Document Root option:
Then, you can use the Upload button to upload each file:
Step 4: Run the Duplicator install process
Now, you can head to
newdomain.com/installer.php to run the Duplicator install process, where
newdomain.com is, obviously, your actual domain name:
Enter the details for the database you created in step 2:
And then on the next screen – you hit a very important step: specifying your new domain name.
Duplicator should automatically detect your new domain. But if not, make sure you enter your exact URL in the box:
Then, Duplicator will handle updating all your internal URLs and image links to reflect your new domain.
Once that’s done, all you need to do is hit the Save Permalinks button to update your links (important!) and then test your site to make sure everything is working properly:
And that’s all you need to do to move WordPress to a new domain name. If you didn’t care about your SEO rankings, you could call it a day right now.
But I told you this guide is about covering both parts. So let’s get into the second half next:
You need to do two things here:
- Set up 301 redirects to send all links and traffic from your old domain to your new domain.
- Tell Google that you changed your domain name
How to set up 301 redirects from your old domain
301 redirects basically tell web browsers (and search engines) that your site has permanently moved. For example, with proper 301 redirects, anyone who goes to
olddomain.com/example will automatically get redirected to
newdomain.com/example. This helps:
- Preserve your traffic
- Keep the SEO value of links pointed to your old website
Setting up 301 redirects is simple. But there is one catch:
You’ll need to keep paying for your old domain name.
See, in order to keep the 301 redirects active, you need to maintain access to your original domain name as well. Still, $10 per year is a small price to pay for maintaining your rankings!
To add 301 redirects, all you need to do is edit the
.htaccess file for your old site and include the following code:
#Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
Just make sure to replace
http://www.newdomain.com/ with the actual link to your new domain name.
.htaccess file is in the root directory of your site. That is, the same directory that includes “wp-admin” and “wp-content”. You can either access it using an FTP program or edit it in your browser using File Manager like I showed you above.
Once you add the code to your
.htaccess file, make sure that it’s working properly by visiting a page on your old domain. You should be automatically sent to the equivalent page on your new domain name.
How to tell Google that you changed your domain name
When you move WordPress to a new domain name, it’s also a good idea to give Google a heads up. Nowadays, Google actually gives you a form that you can fill out letting them know you changed your domain name.
To access it, head to Google Search Console and open the Property for your old domain name (if you never registered your site with Google Search Console, you’ll need to do that first).
Then, click on the Settings gear icon and choose Change of Address:
Then, fill out the form and click submit:
Wrap up and other housekeeping
In addition to the two core steps above, it’s also a good idea to perform some other basic housekeeping tasks. Some things you’ll want to do are:
- Create a new Google Analytics account for your new domain.
- Update all of your social media profiles
- Email people linking to you and ask them to update to your new domain name (yes, 301 redirects will cover this – but it’s better user experience to update the actual URL whenever possible)
- Create a post discussing the name change so your readers know what happened.
Even if you properly followed all of these steps, your rankings will probably still take a small hit in the short term. Unfortunately, that’s pretty much unavoidable because of the magnitude of the change you’re making.
But as long as you’ve implemented redirects properly, you should be back near your original rankings in not too long!
Need anything clarified? Feel free to ask in the comments.