Before changing your WordPress domain, it’s essential to approach the process with caution and attention to detail. Moving your website to a new domain can seem like a daunting task, but with the right steps, you can make the transition smooth and successful. In this guide, we’ll walk you through the necessary preparations and the steps to safely change your WordPress domain while minimizing risks such as broken links, loss of SEO rankings, and other potential issues. Whether you’re rebranding, upgrading your domain, or switching hosting providers, this process will ensure that your website continues to function seamlessly after the switch. Let’s dive into the key steps for changing your WordPress domain.

Disable Any Redirection Plugin or WordPress Security Plugin or WordPress Login URL Change Plugin for Collision Prevention

Before proceeding with a domain change, it is crucial to ensure that no plugins conflict with the process. Conflicts can cause redirection loops or prevent your site from loading correctly. Follow these steps:

  1. Log in to your WordPress dashboard.
  2. Go to Plugins > Installed Plugins.
  3. Look for any plugins that handle redirection, Change WordPress login URL, or enforce security-related URL changes or WordPress Security Plugins.
  4. Deactivate these plugins temporarily. Examples include plugins like Redirection, iThemes Security, or WPS Hide Login.

Change WordPress Domain - Deactive Plugins

Once the domain change is complete, you can re-enable these plugins after testing their compatibility with the new domain.

Clear the Cache and Disable Cache Plugins

WordPress Clear cache

Clearing the cache and disabling cache plugins is an important step after changing your WordPress domain. Cache plugins store static versions of your website to improve load times, but they can cause issues by serving outdated content. By clearing the cache and disabling any active cache plugins (WP ROCKET, LITESPEED and etc ), you ensure that your site visitors always see the most current version of your website, reflecting the changes you’ve made. Make sure to disable the cache plugins temporarily to avoid conflicts and enable proper redirection and URL updates.

Change WordPress Domain | Disable Cache Plugin

Backup Your Website, Buy a New Domain, and Have the Old Domain and New Domain at the Same Time

Changing your domain is a significant step, and a full backup ensures you can restore your website if something goes wrong. Here’s what you need to do:

  1. Backup Your Website:
    • Use a plugin like UpdraftPlus, All-in-One WP Migration, or BackupBuddy to create a complete backup of your website.
    • Include both files and the database in your backup.
    • Store the backup on a secure location like your local computer or a cloud storage service (e.g., Google Drive, Dropbox).
  2. Buy a New Domain:
    • Purchase your new domain from a trusted registrar such as Namecheap, GoDaddy, or Google Domains.
    • Ensure the new domain is unique and relevant to your brand.
  3. Keep Both Domains Active:
    • During the transition, both the old and new domains should be functional to avoid downtime or broken links.
    • This ensures that users accessing the old domain are redirected properly once the migration is complete.

Point Your Hosting to Your New Domain

Your hosting provider needs to recognize your new domain. If you’re not familiar with the process, it’s best to ask your hosting provider to handle this for you. However, if you prefer to do it yourself, you can follow these steps:

  • Update DNS Records:
    • Access the DNS management settings of your new domain and point your Domain Records to your Website Hosting recommended record name (you can ask your hosting provider for these values ) .
  • Add the New Domain to Your Hosting:
    • Log in to your hosting control panel (e.g., cPanel, Plesk, or a custom dashboard).
    • Add the new domain under the “Domains” section, or update the primary domain if applicable.

Change WordPress Domain Add New Domain

  • Wait for Propagation:
    • DNS changes may take 24-48 hours to propagate worldwide, although it often happens much faster (com domain usually take 10 minutes to change, domestic domains may take 24-48 hours ).

Reset .htaccess to WordPress Default to Prevent Collisions

Change WordPress Domain - htaccess change

The .htaccess file controls many aspects of how your site behaves, including redirections. Resetting it ensures a clean slate. Here’s how:

  1. Access your site’s root directory via FTP or a file manager in your hosting panel.
  2. Locate the .htaccess file. If you can’t see it, enable the option to view hidden files.
  3. Replace the existing content with the default WordPress .htaccess code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  1. Save the file and upload it back to the server if necessary.

Change wp_options Table Value of “home” and “siteurl” to New URL

Change WordPress Domain Change Wp Option table Value

The wp_options table in your database stores critical site information, including the domain. To update it:

  1. Log in to your hosting control panel and open phpMyAdmin.
  2. Select your WordPress database.
  3. Locate the wp_options table (or a similarly named table if you changed the prefix).
  4. Edit the home and siteurl rows:
    • Replace the old domain with the new domain  (e.g.,if you have ssl on your website replace  https://olddomain.com with https://newdomain.com or for non https websites http://olddomain.com with http://newdomain.com).
  5. Save the changes.

Add WP_HOME and WP_SITEURL to wp-config.php

Change WordPress Domain - Change Wp Config

Adding the domain information to the wp-config.php file provides an additional layer of consistency. Follow these steps:

  • Access your site’s root directory using an FTP client or file manager.
  • Open the wp-config.php file for editing.
  • Add or Update the following lines, replacing https://newdomain.com with your new domain
    if you have ssl on your website add

define('WP_HOME','https://newdomain.com');

define('WP_SITEURL','https://newdomain.com');

if you dont have ssl on your website add :
define('WP_HOME','http://newdomain.com');

define('WP_SITEURL','http://newdomain.com');

  1. Save the file and upload it back to the server if necessary.

Open Your Website in New Domain and Go to Admin Dashboard

Once the above steps are completed, visit your website using the new domain. Log in to the WordPress admin dashboard by navigating to http://newdomain.com/wp-admin. to do further changes to continue “Change WordPress Domain” Process.

Install Better Search Replace Plugin and Replace Old Domain

Change WordPress Domain - Better Search Replace

To ensure all references to the old domain are replaced, use the Better Search Replace plugin:

  1. Go to Plugins > Add New in your WordPress dashboard.
  2. Search for “Better Search Replace” and install it.
  3. Go to Tools > Better Search Replace.
  4. Enter your old domain (e.g., olddomain.com) in the “Search for” field.
  5. Enter your new domain (e.g., newdomain.com) in the “Replace with” field.
  6. Select all tables to search and replace.
  7. Check “case insensitive” and “Replace GUID”
  8. Uncheck “Run as Dry” to apply the changes.
  9. Run the search and replace operation.

Change WordPress Domain - Better Search Replace - Settings

Reset your SEO plugins Settings

Open your SEO plugin settings and reset the values to ensure they align with your new website’s SEO structure and guidelines.

Change Your URL to New Domain in Google Search Console

Once you’ve successfully changed your WordPress domain, it’s crucial to update your Google Search Console (GSC) to reflect the new domain. This step ensures that Google properly indexes your new domain and continues to track your site’s performance.

You Should Go to Your Property Setting and inform google the domain change.

This informs Google of the domain change and helps with the seamless transfer of SEO signals like backlinks and rankings from the old domain to the new one. Additionally, make sure to update any sitemap submissions and monitor GSC for crawl errors or issues related to the domain transition. This ensures that Google recognizes and properly indexes your new domain, minimizing potential SEO disruptions.

Change WordPress Domain - Change Search Console URL

Ta-Daaa! Done

Your WordPress domain change is now complete and you Changed WordPress Domain Successfully. Thoroughly test your website to ensure:

  • All links work correctly.
  • Images and media load without issues.
  • Plugins and themes function as expected.

If you encounter any issues, review each step to ensure everything was configured correctly. Enjoy your website on its new domain!

Leave a Reply

Your email address will not be published. Required fields are marked *