Why Does a Domain Change Usually Lead to SEO Loss?
Changing your domain is one of the riskiest operations on the web. When you change your website's address, you are essentially telling Google that all the authority, backlinks, and history you've built for the old domain over the years must now be transferred to the new address. If this transfer is not done correctly, Google won't understand that the new domain is the same site as before, and you'll effectively be starting from scratch.
The most significant damage during a domain change occurs when redirects are incomplete, internal links aren't updated, or notifying Google is forgotten. In this article, you'll learn exactly how to perform these three steps without errors to preserve your rankings.
Step One: Preparation Before the Domain Change
Before taking any action, you need to fully understand the current state of your website. This will help you later determine if anything has been missed.
Create a Full Backup
Take a complete backup of your website's files and database. If you use cPanel, use the Backup section to create a compressed file of the entire public_html and an SQL export of the database. Store this backup on a local hard drive or cloud storage, not on the same server.
Record Current Rankings
Before the migration, take screenshots or record the rankings of your important keywords in a file. Tools like Ahrefs or SEMrush can do this automatically. Also, get a full performance report from Search Console so you can compare later.
Audit Internal Links
Using tools like Screaming Frog or even a simple database search, find all internal links that point to your current domain. These links will need to be updated later.
Step Two: Setting Up Complete 301 Redirects
A 301 redirect tells Google that a page has been permanently moved to a new address. This is the most critical part of a domain change, and if done incorrectly, all of your site's authority will be lost.
Redirects in Apache Using the .htaccess File
If your server runs Apache, the simplest way is to use the .htaccess file. Place the following code at the beginning of this file on the old domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L]
This code redirects all URLs from the old domain to the same path on the new domain. So, if a user visits old-domain.com/blog/post, they will be redirected to new-domain.com/blog/post.
Redirects in Nginx
If you use Nginx, add this code to the server block for the old domain:
server {
listen 80;
server_name old-domain.com www.old-domain.com;
return 301 https://new-domain.com$request_uri;
}
Common Mistake: Forgetting the www and non-www Versions
One common mistake is only redirecting one version of the domain (e.g., without www). Make sure to cover both versions. In the example above, the (www\.)? pattern in Apache and listing both names in Nginx handle this.
Redirecting Specific Pages
If your site's URL structure has changed, you'll need to write a separate redirect for each old page. For example:
Redirect 301 /old-page.html https://new-domain.com/new-page
If you have a WordPress site, plugins like Redirection can simplify this, but for large sites, manually writing redirects in the server file gives you more control.
Step Three: Updating Internal Links
The 301 redirect handles the transfer of authority, but for a better user experience and faster indexing, you should also update your site's internal links.
Search and Replace in the Database
In your site's database, find all references to the old domain and replace them with the new one. If you're working with MySQL, use the following command:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'old-domain.com', 'new-domain.com');
Note that this command is only for the WordPress posts table. If you use a different CMS, find the relevant table. Other tables like wp_options may also contain your site's URL, which you should change from the WordPress settings.
Common Mistake: Replacing Across the Entire Database Without Checking
Before running the REPLACE command, make sure you have a database export. If a mistake occurs, you need to be able to revert. Also, be careful not to accidentally change URLs that intentionally point to another domain.
Updating Theme Files and Settings
In theme files, configuration files, and anywhere else the site URL is hardcoded, you need to replace it with the new domain. In WordPress, change the Site Address and WordPress Address from Settings > General.
Step Four: Notifying Google
After setting up redirects and updating links, you need to tell Google that your site has changed its address. This is done through Search Console.
Registering the New Domain in Search Console
First, add the new domain as a new Property in Search Console and verify ownership. Then, submit a new sitemap for the new domain.
The Change of Address Tool
In the Search Console for the old domain, go to the Settings section and select the Change of Address option. Choose the new domain from the list. This tool tells Google that all the authority from the old domain should be transferred to the new one.
Common Mistake: Using Change of Address Before Everything is Ready
Only use this tool when you are sure the redirects are working correctly and the new site is fully accessible without issues. If you do this too early and a problem arises later, Google might consider the migration unsuccessful.
Step Five: Monitoring and Troubleshooting After the Migration
A domain change is not a one-day process. You should monitor your site's status for at least a few weeks.
Checking for 404 Errors
In the Search Console for the new domain, go to the Pages section and check for 404 errors. If you find a page that hasn't been redirected, add a redirect for it.
Monitoring Rankings and Traffic
Check the rankings of your important keywords weekly. A temporary drop in rankings during the first few weeks is normal, but if there's no improvement after a month, you need to investigate the issue.
Checking Backlinks
Backlinks pointing to the old domain transfer their authority to the new domain through the 301 redirect. Use tools like Ahrefs to ensure this transfer is happening correctly.
Additional Tips for a Smooth Migration
There are a few more tips that can make the domain change process smoother:
- The best time for the migration is during low-traffic days of the week, so if a problem arises, you have enough time to fix it.
- Before the migration, make sure SSL is activated on the new domain to avoid security errors.
- If your site relies on external services like CDN or email marketing, update the addresses in those services as well.
- Inform your users via email or social media that your site's address has changed.
If your site is hosted on cloud infrastructure or shared hosting, make sure the DNS settings for the new domain are configured correctly. Hosting services usually provide tools for managing DNS that you can use. ServerNet, as a hosting service provider, also gives you full control over DNS management and redirect configuration.
Conclusion
A domain change, if done carefully, should not lead to SEO loss. Remember the three golden rules: complete 301 redirects for all URLs, updating internal links, and notifying Google via Search Console. If you execute these three steps correctly, Google will understand that your site has only changed its address and will transfer the previous authority to the new domain.
Finally, be patient. Google may take a few weeks to index all the new pages and for rankings to return to normal. If you still notice specific issues after a month, re-check your redirects and the robots.txt file.