How to move your WordPress site
Changing your website’s domain name can significantly impact your SEO rankings, so it’s a process that needs to be done very carefully.
While you cannot avoid temporary SEO fluctuations when migrating your website to a new domain, you can definitely minimize the impact and quickly regain your search traffic and rankings.
In this guide, we will show you the proper way to move WordPress to a new domain without losing SEO.
Here’s the 5 step process that we’ll cover to help you migrate your WordPress site to a new domain name:
- Create a Duplicator package of your WordPress site
- Create a database for your new domain name
- Unpack WordPress on the new domain
- Setup permanent 301 redirects
- Notify Google about the change
What to Know Before You Change Domains
Before you start, there are a few things you should know.
The process of transferring to a new domain will temporarily affect your search engine rankings, since Google and other search engines will need to adjust to the changes.
Yes, this will also temporarily affect your search traffic as well. Please keep in mind that this is normal, and it happens to all websites that switch to a new domain.
However, you can dramatically decrease the SEO impact by following this guide. We will show you the right way of moving your WordPress site to a new domain name, setting up proper 301 redirects, and notifying search engines.
Please note that this guide is not for moving WordPress site to a new host. This is for switching a domain name only. While the process is similar, there are a few extra steps involved in this process. These extra steps will help you to protect your SEO rankings and traffic.
Lastly, if your old website is on WordPress.com, then you need to follow the instructions in our guide on how to move from WordPress.com to WordPress.org instead.
Pre-Steps: What You Need to Get Started
In this guide, we are assuming that you have your WordPress website setup on oldsite.com, and you are trying to migrate it to newsite.com.
We are also assuming that you already have a WordPress hosting account, and you are familiar with your web hosting control panel.
You’ll also need to know how to use an FTP client like FileZilla, or how to edit files using the File Manager app available under your hosting account dashboard.
In case you don’t have a web hosting provider or are looking to switch to a new one, we recommend using Bluehost (great for small sites + comes with a free domain) and either SiteGround or WP Engine (great for larger sites or online stores).
Once you have those things in place, you’re ready to start the process!
Step 1: Create a Duplicator Package of Your WordPress Site
The first thing you need to do is create a full backup of your WordPress site. We’ll use this backup to create a duplicate of your website, so you can set up the redirects properly from your old domain to the new one.
Once activated, the plugin will add a Duplicator menu item in your WordPress admin. You need to click on the Duplicator menu, and then click on the ‘Create New’ button to create a new package, or copy of your WordPress site.
After that, you will be asked to click on the Next button to continue.
Duplicator will now run the website duplicator wizard. First, it will run some tests to see if everything is in order. If the plugin finds an issue, then you will see a warning with instructions.
If all items are marked ‘Good’, then click on the ‘Build’ button.
The plugin will now start creating a duplicator package of your website files. This process may take a few minutes depending on the size of your site.
Once finished, you’ll see download options for the Installer and the Archive package. You need to click on the ‘One-click download’ link to download both files to your computer.
The archive file is a complete copy of your WordPress files. It includes your WordPress themes, permalinks settings, plugins, uploads, and any other files created by WordPress plugins.
The installer script is a PHP file that will automate and run the WordPress migration by unpacking the archive file.
Step 2. Create a Database for Your New Domain Name
Before you can move your WordPress site to the new domain, you’ll need a new SQL database to unpack WordPress on your new domain name.
If you have already created a database, then you can skip this step.
To create a database, you need to visit your hosting account’s cPanel dashboard, scroll down to the ‘Databases’ section, and then click on the ‘MySQL Databases’ icon.
Note: Your hosting control panel may look slightly different than the screenshots. However, you should still be able to find a Databases section with an option to create a new database.
Simply provide a name for your database and then click on the ‘Create Database’ button.
cPanel will now create a new database for you. After that, you need to scroll down to the MySQL Users section.
Next, provide a username and password for your new user and click on the ‘Create a user’ button. Make sure to note the username and password in a safe place.
The new user you just created still does not have permission to work on the database. Let’s change that.
Scroll down to the ‘Add User to Database’ section. First select the database user you created from the dropdown menu next to the ‘User’ field. Then select the new database you just created and click on the Add button.
Your database is now ready to be used for moving WordPress to the new domain name. Make sure to note down the database name, username, and password. You’ll need this information in the next step.
Step 3. Unpack WordPress on Your New Domain Name
Now you need to upload the Duplicator files you downloaded earlier to your new domain name.
The Duplicator package includes your WordPress installation as well. This means you don’t need to install WordPress on your new domain.
First, connect to your domain name using an FTP client. Once connected, make sure that the root directory of your website is completely empty.
After that, you can upload the archive and installer files to the root directory (usually it is public_html).
Once both files have finished uploading, you are now ready to unpack WordPress.
Open a new browser tab and go to the following URL:
Don’t forget to replace example.com with your new domain name. This will launch the Duplicator migration wizard.
The installer will look for the archive file. You need to check the terms checkbox and click on the Next button to continue.
Now, the installer will ask you to configure your WordPress database information.
Your host will likely be localhost. After that, you will enter the details of the database you created for your new domain name in the earlier step.
Once done, click on the next button to continue.
Duplicator will now unpack your WordPress database backup from the archive into your new database.
Next, it will ask you to update the site URL or Path. You shouldn’t have to change anything since it automatically detects the new URL of your domain name and its path.
If it doesn’t, then you can change the URL to your new domain name. After that, click on the next button to continue.
Duplicator will now finish the migration.
You can click on the ‘Admin Login’ button to enter the WordPress admin area of your website on the new domain name.
Step 4. Set Up Permanent 301 Redirects
The next step is to point users arriving on your old domain name to the new domain. This is done by setting up 301 redirects.
301 redirects are very important for SEO and user experience. Adding them will allow you to automatically redirect users and search engines to your new domain name.
In other words, whenever someone lands on a post or page on your old domain, they will be automatically redirected to the same post or page on your new domain, instead of seeing a 404 error.
To keep your redirects in place, you’ll need to keep your old WordPress installation active so it can continue to redirect to the new one you just created.
There are two ways to set up the redirects. The first method is easy and just takes a few clicks. The second method requires you to edit files manually.
Method 1. Set Up 301 Redirects With All in One SEO
For this method, we’ll be using All in One SEO (AIOSEO). It is the best WordPress SEO plugin on the market and allows you to easily optimize your WordPress website for SEO.
Note: You’ll need at least the Pro version of the plugin to access redirect manager addon. You can also set up AIOSEO on your new WordPress site to boost your search engine rankings and traffic even more.
Upon activation on your old domain, you need to visit All in One SEO » Redirects page and click on the Activate Redirects button.
Next, you need to switch to the ‘Full Site Redirect’ tab and turn on the ‘Relocate Site’ toggle. After that, you need to enter your new domain name next to ‘Relocate to domain’ option.
Don’t forget to click on the Save Changes button to store your settings.
Method 2. Manually Set Up Redirects to New Domain
This method requires you to edit the WordPress .htaccess file on your old domain name.
First, you need to connect to your old site using FTP and edit the .htaccess file.
This will be located in the same directory as your wp-includes or wp-admin folder. Open the .htaccess file and paste the following lines of code at the very top:
#Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
Note: Replace newsite.com with your new domain in the above code.
Once you have applied these changes, then visit your old domain name. It should automatically redirect you to the new domain.
If it doesn’t, then it means the redirection is not setup properly, and your server likely doesn’t support redirect rules. You need to contact the support team at your web hosting company to get RewriteEngine turned on.
Step 5. Notify Google About Your New Domain
Now that you have moved WordPress to a new domain name and set up redirects, it is time to notify Google about your change of address. This will help Google find your new website domain quickly and start showing it in search results.
First you need to make sure that both your new and old domain are added to the Google Search Console as two different properties. See step 1 in our Google Search Console guide for instructions.
Next, you need to select the old domain name as the active property in your Google Search Console account dashboard.
After that, click on the Settings menu from the left column and then click on the ‘Change of Address’ tool.
Now you need to select your new domain under the Update Google section, and then click on the ‘Validate & Update’ button.
That’s all, Google will now validate that your old domain is redirecting to the new domain and save your changes.
On the next screen, Google Search Console will show you a step by step wizard to submit your change of address request.
Notify Your Users About the New Domain Name
While the 301 redirects do their job, it is always good to make a public announcement about the migration.
You can do this by simply writing a blog post on your new site and sharing it on your social media accounts.
This can be helpful in a lot of ways.
First and foremost, your users are more likely to remember the new domain once they read about it.
Second, you can ask your users to let you know if they see any bugs. You alone cannot test your site in every different type of browsers or system environment. It’s always helpful to have a fresh pair of eyes looking at it.
We hope that this tutorial helped you move your WordPress site to a new domain name. You may also want to see our guide on how to get a free email domain, or see our expert pick of the best business phone services.
The post How to Easily Move WordPress to a New Domain (Without Losing SEO) appeared first on WPBeginner.