How To Change The Domain Name of A WordPress Website?

Do you want to change the domain name of your existing website? If yes, here I have written a simple, step by step tutorial that shows anyone how to change the domain name of a WordPress website, without facing any downtime or without needing any external help. It isn’t as difficult as people make it sound. I recently changed the domain name of one of my WordPress blogs. The only reason for changing the domain name of my site was because the previous domain name wasn’t reflecting the main content or the theme of my website. People had no idea what my website was all about when they came across my old domain name.  My new domain name perfectly represents what our website stands for. So changing the domain name never felt like a big deal for me, except for losing the ‘domain age’ factor. Now without further ado let’s have a look at the steps involved in the process of changing the domain name of a WordPress website.

Changing The Domain Name of An Existing WordPress website: Steps Involved

The steps involved in the domain name changing process can be broadly divided into the following.
  • Registering the new domain name
  • Connecting the domain name with the hosting account
  • Cloning the WordPress site or exporting the content from the old domain and importing it into the new domain, if they are on different hosting accounts.
  • Creating 301 redirects from the old domain name to the new domain name.
  • Connecting and verifying the new domain name with Google Webmaster.
  • Using the ‘change of address’ tool in the Google Webmaster to let Google know about our website’s name change.
how to change the domain name of an existing website

Registering The New Domain Name

You need to register the new domain name first before you start to change the domain name of a WordPress website. I always register my domain names at NameCheap. They offer great domain services at affordable costs. They also offer free privacy protection, unlike many other popular services that charge a hefty fee for the same. I already had the type of domain name I wanted in mind, and strangely, after searching for a few minutes I got hold of this unique, brandable domain name. I immediately registered it. Click the following link if you don’t know how to register a domain name.

Connecting The Domain Name To Web Hosting

To connect your new domain name to the web hosting service, all you need to do is update the ‘NameServers’. Every hosting company provides you with a set of NameServers unique to them. By pointing your domain name to these nameservers, you can easily connect the domain to that particular Webhosting service. I am pretty sure you are already aware of these things. However, I didn’t have to do all those things because for this tutorial both my domain name and hosting providers are the same. Its NameCheap. So all I had to do was change the setting from inside the dashboard and point to the NameCheap Webhosting DNS. namecheap webhosting name servers

Addon The New Domain Name

Now, you need to add your new domain name to the existing web hosting, through the ‘addon’ domain name feature, provided your hosting plan supports unlimited domain names. The procedure is straight forward. Once you are finished with this step, its time to move the content on your website to the new domain name. addon domain

Moving The Content of Your WordPress Website from Old Domain Name to New Domain Name

There are many ways to migrate the content of the WordPress website from one domain to another. But the easiest way to move the content of your existing WordPress site to a new domain name is by using the ‘cloning’ feature included in your web hosting cPanel. Go to the ‘Softaculous Apps Installer’ section in your cPanel and click on ‘WordPress’. softaculous Now on the next page, choose the WordPress installation that you want to move to a new domain name. And click on the clone button, as shown in the picture below. clone Now on the next page, choose the destination URL. It is your new domain name, where you want to move the WordPress site. Choose the new domain name and hit the ‘clone installation’ button to complete the migration of your WordPress website. clone installation And that’s it. You have successfully moved your WordPress website from your old domain name to a new domain name.

Changing Internal Links

If you have followed the process exactly how I showed above, you won’t have to change the internal links, as it would have automatically been done during the cloning process. However, it is better to have a second look, just in case. Once the above steps are completed, its time to notify search engines about the change of domain name of our WordPress site. This is done by creating ‘301 redirects’ from the old domain name to the new domain name and notifying Google using the ‘change of address’ tool.

Creating 301 Redirects

A 301 redirect is a permanent redirect of one URL to another. By creating 301 redirects we tell the search engines that we have permanently moved our web page or the content to a completely new address or URL. This is supposed to be one of the best practices to be performed when moving a website from one domain name to another. Without a 301 redirect, our old website won’t pass any link juice or the ranking power to the new website. So it is vital to create 301 redirects when you plan to change the domain name of your existing website. Many people create ‘301 redirects’ in the wrong way. Most of them redirect all the pages and posts in their old domain to the homepage of the new domain. But that doesn’t serve any purpose. If a person finds an article from your old domain in the search engine and clicks the link, he/she will be taken to the homepage of your new website instead of the page containing relevant content. Which is not the visitor wants. Right? So it is always smarter to create pagewise 301 redirects from the old domain to corresponding pages and posts in the new domain.

Creating 301 Redirects With a Plugin

I used the Yoast SEO Pro plugin to create pagewise 301 redirects from my old domain to the new domain. Everything seemed to be working fine. But later when I was trying to use the change the address tool in my Google Webmaster account somehow Google didn’t seem to read those 301 redirects. So I had to drop this method and use the .htaccess 301 redirects instead. Don’t worry if you don’t understand what .htaccess is. I don’t understand it completely either. BTW we only need to change some text in this file to create pagewise 301 redirects. For your information .htaccess is a configuration file that is used on the web servers that run the Apache Web Server software.

Creating .htaccess 301 Redirects

To create a .htaccess 301 redirect we have to edit the .htaccess file and add some text as given below. But for that, I had to locate the .htaccess file first. I used the file manager, and opened the corresponding domain (old domain) folder and located the .htaccess file inside the folder. htaccess file Then I edited the .htaccess file and added the following command/text. And one more thing. Don’t forget to copy and save the .htaccess file somewhere safe before editing it. It will come handy if something goes wrong. Following is the .htaccess file format for creating pagewise 301 redirects from the old domain name to the new domain name. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} olddomain\.com$ RewriteRule ^(.*)$$1 [R=301,L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress And that was it. This method really works and redirects all the pages and posts from the old domain to the corresponding pages/posts in the new domain.

Verifying The Domain Name With Google Webmaster

Before using the ‘change of address’ tool, we need to verify both our domain names with the Google Webmaster. I am sure you are aware of the process of connecting and verifying the website with Google Webmaster. I am not going to explain the same process here again. If you don’t know the process, please read this article by Google about verifying your site ownership.

Using The Change Of Address Tool

Now the final step in the process of changing the domain name of the website is to use the ‘change of address tool‘ and let Google know that you are changing the website’s address. By using the change of address tool we notify Google about the new URLs for your existing content so that Google can update its index to reflect the new domain for your pages. This updated index status remains in effect for 180 days, by which time Googlebot will have crawled and indexed the pages at the new address of your website. If you have performed all the earlier tasks properly, using the change of address tool can be a walk in the park. If not, it can really mess things up. To use the ‘change of address tool’ we need to visit the Google Webmaster dashboard and choose the domain name that we want to move to a new address. And then click on the setting tab to access the change of address tool. On the next page, choose the new domain name. And now click on the ‘validate and update’ button. Now, if you have done everything properly, you will see the following notification on the next page. Click on the ‘confirm move’ button. how to change the domain name And that’s it. You will get the following notification if everything is done correctly. site is moving And that my friend is how to change the domain name of a WordPress website. If you have any questions regarding this, please feel free to contact me.

Similar Posts