Sometimes you may find a need to change the domain name of your WordPress website. This can be due to any reason- Maybe you find a better domain or you were using a temporary domain for testing and Now you want to switch to the main domain or anything else. In every case, you need to change the domain of your WordPress website.
Before you make any changes to your site its recommended that you take the full backup of your website.
you don’t have to do it manually. There are a lot of plugins available that you can use to create A full backup. You can use-
In this guide, I am using All-in-One WP Migration for both creating the backup and restoring the backup.
To create a backup of your old site install this plugin and click on All-in-One WP Migration available in the left menu of your WordPress Dashboard.
Click on EXPORT TO > FILE option. It will create a single file of your WordPress site(including media files). After completing the process Download the file.
Install WordPress to your new domain. If you don’t know How to Install WordPress you can follow this guide- How to install WordPress.
Note: In the free version, you are allowed to import a 512MB file. If your website is more then that you have to get the premium version of this plugin.
Now as you have setup WordPress to your new domain Install the same plugin(All-in-One WP Migration) to your new domain.
After installing plugin click on All-in-One WP Migration > import to import the backup file you created before.
Now select the .wpress file to start the import the process.
Once the importing file is completed click “CONTINUE” to overwrite all your existing file to the new files. Since it is a new installation you need not to worry about anything.
After successful completion of importing process, review all your setting are fine and your new domain is the exact replica of your old domain by visiting your new domain.
NOTE- Since you imported all your setting and database from the old site, Your Dashboard URL, database username-password, dashboard username-password and all other credentials will be changed to same as on the old website.
Setting up a permanent 301 redirection is very important for both SEO and user experience.
Setting up redirection allow to redirect all your old site traffic to the new site automatically.
To set up 301 redirection you need to login to your server and change the .htaccess file a little bit. You will find this file in your root directory.
open, .htaccess file and paste this code into it-
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
Replace newsite.com to your new domain.
If you don’t want to lose your SEO you must inform Google about the migration of your old domain to new domain.
To inform Google, login to your Google Search Console Account and select Your old domain.
Now click on the gear icon on right top and select “Change of Address”
Now below screen will be opened
Note: When verifying your old domain you need to remove the 301 redirection for a while as your old domain will be redirected to the new domain and you won’t be able to verify your old domain.
Click “SUBMIT” button to submit the change of redirection request. It will take some time to complete the process.
While 301 redirection does the job its good to announce to the public about the migration So that they won’t be surprised when they are redirected form old-domain to the new-domain.
You can do it by simply writing a blog post on your new domain or sending mailers to your users or simple notification of migration on your new domain.
Once you migrated your domain do not forget to share your experience and share the post.
I am the owner of acmeextension. I am a passionate writter and reader. I like writting technical stuff and simplifying complex stuff.