Are you considering migrating your website to a new domain but worried about losing your hard-earned SEO rankings? Changing domains can be a daunting task, especially when it comes to preserving your SEO efforts.
Fortunately, migrating a website to a new domain doesn't have to be a nightmare. In this article, we will show you a step-by-step guide with best practices to ensure a smooth transition of migrating a WordPress website to a new domain.
- Why do you want to change the domain name?
- How to migrate a WordPress website to a new domain?
- Set up redirects from the old domain to the new one
- Updating your links
- Update Google Search Console
- Does changing a domain name affect SEO?
Why do you want to change the domain name?
Changing a domain name can become necessary for various reasons. Sometimes, your business go through rebranding processes and choose to change its name, requiring you to update the domain as well.
Other times, you might find a more appealing or shorter domain that better represents your brand. In some cases, it may involve merging multiple sites into one, requiring a new domain name to encompass all the content.
How to migrate a WordPress website to a new domain?
Migrating a website to a new domain can be a daunting task, but with careful planning and execution, it can be done successfully without losing SEO. You can do it manually or with the help of migration plugins.
Changing domain name without changing host
If you are changing the domain name but staying with the same host, then it's the simplest situation. In this case, you don't have to move your files and database from host to host. Instead, you only need to update your website URL in the database.
Before going into the details, please make sure that you already point your new domain to the same server or hosting.
Using WP-CLI
WP-CLI is a powerful tool that allows you to manage and interact with your WordPress websites directly from the command line. With its extensive range of commands and functionalities, WP-CLI allows you to perform essential actions such as plugin and theme management, database manipulation, content migration, and much more.
If you are using a VPS or a hosting where WP-CLI is available, you can run this command:
$ wp search-replace "https://yourolddomain.com" "https://yournewdomain.com"
This command will search for all URLs that contain "https://yourolddomain.com" in your database and replace it with "https://yournewdomain.com". After that, you can access to the website with the new domain.
Using Better Search Replace plugin for WordPress
If WP-CLI is not available on your host, or you're not familiar with using it from the command line, then you can do it with UI.
The first step is going to your WordPress dashboard > Settings > General and change your website URL to the new domain:
After doing that, you'll be logged out from WordPress. Don't worry, just log in again. This step will change your website URL to the new domain, and you can still navigate to your posts without problem.
However, URLs of images in the post content, or internal links between posts are still use the old domain. To update them to the new one, you'll need to use the Better Search Replace plugin.
Go to Plugins > Add new and search for "better search replace":
Install and activate the plugin. Then go to Tools > Better Search Replace and enter your old domain name and your new domain name:
Don't forget to select all tables and then click Run Search/Replace button. The plugin will search and replace all old URLs with your new URLs in your post content.
And now your website fully works with the new domain, and you can view the homepage or any posts, pages to check if it work properly.
Manually migrating WordPress to a new host
If you not only changing your website domain, but also move it to another server/hosting, then the process requires migrating database and files. Follow these steps to know how to do it manually:
Migrating database
First, you need to export your database. Go to your hosting control panel and navigate to the phpMyAdmin tool, and select your database, and then select the Export tab:
And click the Export button to export your database to SQL file.
Now go to your new hosting control panel > MySQL databases and create a new database:
Don't forget to create a new MySQL user and add it to the database:
After that, you need to import the database from the exported SQL file above. Go to phpMyAdmin tool, and select your database, then select the Import tab:
Select your SQL file and click Import.
Migrating files
The next step is migrating files from your old host to the new one. You can do so by using an FTP client to connect to your current domain's server and download all the files. Then connect to your new domain's server and upload them.
Or you can use the File Manager in cPanel to zip the whole website's folder and download it. Zipping file can make it download faster than using an FTP client.
Next, connect to the new domain's server and upload the zipped file. Then extract the files in the new domain's root directory.
Search and replace the domain name
The final step is updating the domain name for your website. This step is the same as the in the section "Changing domain name without changing host". So please see details above.
Now you know how to manually move your WordPress website to a new host. It's important to thoroughly test the website to ensure all pages, links, and functionality are working properly.
Using InstaWP as your WordPress Sandbox
InstaWP is a great tool when it comes to migrating your site, no matter what’s the scenario.
For this, you will have to create an account with InstaWP and connect your current (live) website to it. Go to your InstaWP dashboard > Connect and click Connect Site + to begin the process.
Enter your live site’s URL and click Connect Site to proceed.
To authorize the creation of a staging site, you must log in to your live site’s WordPress admin dashboard.
Select Yes, I approve this connection to complete the staging site’s creation.
Success staging of your live site will install the InstaWP Connect plugin to your live site, and replicate your live site to your InstaWP dashboard.
You can see a new staging site with its status as Connected.
Now that you have a staging environment ready, you can play around with this version of your website and make all SEO changes without worrying about how it will impact your live site.
Once everything is well-tested and ready to go live, connect your server from the Hosting page to your InstaWP account.
Now, go to the Sites page, find your staging site, and select Migrate V2 option for it.
Go to the Create New Live Site tab, select the desired hosting provider, enter the domain name, choose a PHP version, and pick a Pack before hitting the Create & Migrate button.
That’s it. You can now go to the new domain and check if everything went well. Your site is migrated to the new domain.
Easy; wasn’t it?!
Using WordPress migration plugins
Although you can do all of the steps above manually, it takes quite a lot of time. There's a better way to do so using a WordPress migration plugin. Here are a few notable (free) options:
InstaWP Connect
InstaWP Connect unlocks the best way to migrate your WordPress website to a new domain without losing SEO. The plugin lets you create staging from your live site in just 1 click, which can then be modified as per your requirements and migrated to the new domain hassle-freely.
You can:
- Install the InstaWP Connect plugin on your website;
- Sign up for a free InstaWP account and connect your site to is using the plugin;
- Use the plugin for 1-click staging, migration, and 2-way sync
The best part is – as you will be making all the changes to your live site’s replica in a staging environment, any mistake in the process won’t hamper your live site.
Make the new version live on the new domain once you have tested all the changes perfectly in the WordPress sandbox powered by InstaWP.
Duplicator
Duplicator simplifies the migration process by creating a package of all your site's files, database, themes, and plugins. You can then simply upload this package to the new domain and run the installer. Duplicator also offers options to update URLs, manage redirects, and optimize your database during the migration.
All-in-One WP Migration
All-in-One WP Migration allows you to export your entire site, including the database, media files, and plugins. It also offers an import feature to easily transfer all the files to the new domain. With All-in-One WP Migration, you can update URLs within the database, ensuring that all internal links point to the new domain. It also handles the management of redirects from the old domain to the new one.
UpdraftPlus
Beyond being a comprehensive backup plugin, UpdraftPlus also provides a migration feature. You can easily clone your site, including all its files, database, themes, and plugins, and migrate it to a new domain. UpdraftPlus allows you to update URLs and manage redirects efficiently. It also offers additional features such as scheduled backups and one-click restoration.
For more options about choosing a migration plugin for WordPress, please read this article: Top WordPress Migration Plugins Comparison.
These WordPress migration plugins streamline the process by providing user-friendly interfaces and automating essential tasks. They allow you to transfer files, update URLs to the new domain, and even manage redirects effortlessly.
Set up redirects from the old domain to the new one
To ensure a seamless website migration to a new domain without losing SEO, it is crucial to set up redirects from the old domain to the new one. Redirects inform search engines and users that the content has permanently moved.
One effective method is to add 301 permanent redirects. These redirects can be set up at the hosting account level or by using a WordPress redirection plugin like Slim SEO. Slim SEO allows you to easily manage redirects within the WordPress dashboard.
Follow the instructions in this article for more details: What is a 301 Redirect? How to Create 301 Redirects in WordPress?
When setting up redirects, it's important to use regular expression (regex) redirects. Regex allows you to redirect multiple pages, posts, or files simultaneously. This ensures that all URLs on the old domain are redirected to their corresponding locations on the new domain.
By implementing permanent redirects, you maintain the search engine rankings and prevent broken links. This helps to retain organic traffic and maintain a positive user experience on the new domain.
Updating your links
Updating your links is a crucial step in maintaing internal linking between your content and also from other websites to your website. Failure to update these links can result in broken links, which not only disrupt the user experience but can also negatively impact your search engine rankings.
Internal links
When you move to a new domain, it's important to update all internal links on your website to point to the new domain. This includes updating links in the navigation menu, footer, sidebar, and within your content. If you follow the instructions above to migrate your WordPress website, then your internal links are already taken care of.
But if you use another method to migrate your site, then you need to update them. Start by identifying all the internal links that need to be switched. A link checker plugin like Slim SEO Link Manager can help you update all the links in bulk:
Backlinks
Next, it's crucial to reach out to your content partners and ask them to update any old links to the new domain. This includes links from guest posts, partnerships, and directories. This will ensure that the valuable backlinks you have acquired over time continue to point to the correct pages on your website.
Furthermore, don't forget to update your profile links on social media platforms. This includes Facebook, LinkedIn, Twitter, Instagram and more. Make sure all the links in your bio or about section are pointing to the new domain.
Update Google Search Console
The final step is telling Google about your change. Doing that by updating your website settings in Google Search Console. Here's how to do it:
1. Navigate to the Search Console Dashboard and select your website property.
2. In the left sidebar, click on "Settings" and then choose "Change of Address".
3. Verify both your old and new domains within the same Google Search Console account if you haven't already done so.
4. Select the new domain from the dropdown menu and click "Continue".
5. Follow the instructions provided to complete the verification process for the new domain.
6. Once your new domain is verified, go back to the "Change of Address" page and click "Submit".
7. Monitor the progress of the domain change in the "Change of Address" section.
Updating Google Search Console with the new domain will help search engines understand the migration and preserve your search rankings and organic traffic. Remember, it's essential to verify and submit the change of address request to have a successful domain migration.
Does changing a domain name affect SEO?
Changing a domain name can have a significant impact on SEO, potentially affecting search engine rankings and organic traffic. However, with the right steps and a careful planning, the impact can be mitigated.
When changing a domain name, there may be a temporary drop in search engine rankings and organic traffic as search engines need time to recognize and process the domain change. Additionally, backlinks pointing to the old domain may become invalid, potentially impacting domain authority.
To minimize the impact, start by updating all URLs throughout the site to reflect the new domain. This includes internal links, sitemaps, and canonical tags. By ensuring that all URLs are correctly redirected, search engines will have a better understanding of the new domain structure.
It is also crucial to inform Google of the domain change by using the "Change of Address" tool in Google Search Console. This tool will help Google recognize the migration and preserve the SEO value associated with the old domain.
Lastly, it is essential to monitor the progress of the domain change in the "Change of Address" section of the Search Console. Keep an eye on any potential issues, such as broken links, and address them promptly.
In summary, changing a domain name can impact SEO, but by following these steps, you can minimize any negative effects and ensure a smooth transition to the new domain while preserving your search visibility and search traffic.