Complete SEO Guide to Changing Your Domain Name

November 21, 2017//5,817 words

Have you ever had to change your primary domain name to a new domain?

Or do you feel stuck in your current domain name but you really want to change it and you’re concerned about the process and the effect that it will have on your SEO and links?

What if I told you that I have a simple blueprint for you to follow that will help you change your primary domain name without hurting your SEO rankings?

I’m going to show you the steps to changing your primary domain name on WordPress and Joomla.

And here’s the thing:

You’re not required to have a background as a developer to follow these steps.

 

Step 1 to changing your primary domain: Backup and Save Everything!

Really anytime you make drastic changes to your website (can anything be more drastic than changing your home address?) you should save and backup your files.

You want to make sure that you back up everything.

That includes your databases which house all of the content that you have written in your WordPress pages and posts and Joomla articles and modules AND your static files (HTML, PHP, and so on).

There’s two ways that you can do this.

 

The EASY way to backup your files

This step will require that you have access to your cPanel.

Most website owners do but if you’re not sure, contact your hosting company.

Log in to your cPanel account and click on Backup Wizard under Files.

change domain name

Select Backup:

change domain name

And select both Home Directory AND MySQL Databases to backup. The reason why we shouldn’t select “Full backup” is because we will need these as separate files later when we restore the backups.

change domain name

Final step before backup – enter your email address to be alerted when the backups are finished and click Generate Backup.

change domain name

Now let it run.

change domain name

Depending on the size of your site, the backup should only take a couple of minutes.

You will then receive an email like this from cPanel telling you what to do next:

change domain name

Now, hit the Back button on your browser or go to your cPanel home page and click on Backup.

change domain name

And then select Download a Full Website Backup.

change domain name

And then locate and select your most recent backups.

change domain name

Make sure to save this file to a secure location that you’re going to remember.

Also:

These files are going to be in GZIP format so you won’t be able to recognize anything:

change domain name

If you did want to see these files (which we will need to later), you can use a program such as 7-Zip to compress or decompress the .gz file.

So …

The easy way was simple but still required a few steps.

Now let’s look at:

 

The EASIEST way to backup your files

Using the Akeeba Backup component for both Joomla and WordPress is one of the easiest and free ways to backup your site.

Simply open the component and click Backup Now.

change domain name

On the next page, enter in any detailed information that would be helpful for you to reference back to later and press Backup Now.

change domain name

Let the process run (it may take a little longer than the cPanel option) and be sure to NOT close the browser.

change domain name

Once the backup is complete, the screen will change and you can click Manage backups.

change domain name

And then select and Download your backup.

change domain name

Now, just like the first method above, you won’t be able to recognize the data in this file once you download.

It will be in JoomlaPack file format (.jpa) which will look just like a GZIP file.

If you need to extract the files from this to say view or replace a single file, leverage theAkeeba Backup’s eXtract Wizard.

Congratulations!

Now you have a solid copy of your website and if anything goes wrong you will be able to undo and restore back to where it was when the backup was made. Isn’t that a good feeling?

Now we can start the change to your new primary domain name.

 

Step 2 to changing your primary domain: Setup your New Domain

This step is not unique to changing your domain name as it is the same process as setting up a new website.

Also, this step may be unnecessary to some.

Here’s a cheat, most hosting companies can change your primary domain for you in their servers without you having to create a new website framework at all.

Definitely explore that possibility before you take the time to set up a new one.

But:

To be thorough, we’re going to walk through the steps to setting up a home for your new domain name.

 

Set up a new hosting account for our domain

Now, if you’re going through the trouble to change your primary domain name, you likely already know exactly what domain you want to use (and hopefully have already purchased it!).

So now we need to connect our domain to a hosting account.

Take some time to do your research as the right (or wrong) hosting account can and will effect your SEO rankings.

Once you register with a hosting company, you will receive information regarding the domain name server (DNS) addresses that you need to point your domain name to.

These are usually 2 addresses similar to this:

change domain name

Once you register and are given these nameserver addresses to point to, update them in your domain account.

change domain name

Now:

These changes make take up to a day or more to take effect or “propagate” but you may start to see changes immediately.

You can still begin to make changes to your site but it just won’t be fully visable on the front-end.

To verify that the changes have taken effect, run your URL through a tool such as Pingdom’s DNS Checker.

 

Step 3 to changing your primary domain: Upload Website Backups from Old Domain

Great work. We’re getting there!

Now we simply want to upload the files that we backed up in step 1 above.

 

The EASY way to restore your old site

You will need to have access to your cPanel for this step.

We’re going to restore the files that we backed up from the cPanel in step 1 above.

Return to the Backup Wizard.

change domain name

But this time, clock on Restore.

change domain name

Now, THIS is why we had to make 2 backups.

You can see that there is the option to restore the “Home Directory” and the “MySQL Databases” but not the full backup.

change domain name

Click on each link and restore your backups.

 

The other slightly less easy way to restore your website (I think they’re both about the same level as easy!)

You will also need access to your cPanel / FTP for this step.

I prefer to use the program Filezilla for easier access to my FTP files. Read about Filezilla and download it here.

Download the Akeeba eXtract Wizard for your operating system and then follow the brief guided setup.

change domain name

Once the program is setup, we can open and select our .JPA file from the Akeeba backup.

change domain name

Once the Akeeba file extraction is complete, you will get an alert and then you will see all of your files organized just like they are in your cPanel.

change domain name

Once these files have been extracted in a safe place on your computer, login to your cPanel or FTP account.

Navigate to your site’s public_html folder and then transfer ALL of these extracted files to the folder.

It will take a good half hour or more depending on your internet speed.

Finally …

Your new site is up and running!

Chances are, however, that there may be some broken links and possible broken image paths.

If, in place of your images, you see this on your site than you have broken image paths.

change domain name

Step 4 to changing your domain name: Repair broken links and images not showing

Fortunately, these are 2 things that are very easy to spot.

For your images, you will be able to see right away if the images are not showing properly.

For your links, we can run a quick scan using Dead Link Checker.

Enter in your URL and press Check.

change domain name

If you have any broken links, you will see the results listed below.

change domain name

This may also uncover other links that have been broken all along.

Either way, locate these pages and update the links.

A nice little plugin that works with WordPress is called Velvet Blues Update URL. Download this for easy conversion. Unfortunately, I don’t have a good alternative for Joomla at the moment. I welcome recommendations and comments below!

Since we have already verified that the images are not displaying properly, we can assume it’s likely because these our website’s files are from our previous domain and therefore, the file paths are still associated with the old domain name.

We need to update our domain name in our files.

First, login to your cPanel or FTP account and go to File Manager then your public_html folder.

Scroll down and locate your configuration.php file.

Find the line that says “public $live_site” and input your NEW domain name.

change domain name

Don’t forget to save your changes!

Now, we have one more step to do to update our domain name in our files.

Go back to cPanel > Databases > phpMyAdmin.

Choose the name of your database on the left and click Export towards the middle of the page.

change domain name

Leave as a SQL format and click Go.

change domain name

Save to a safe place on your computer.

Open in a text editor (I use Sublime – download here) and replace all mentions of your previous domain name with your new one.

An easy way to do that is through the find and replace tool (CTRL + H or CMD + H).

Key in the name of your previous domain (just the name, don’t include “www” or “.com”) in the first line and the name of your new domain in the second.

change domain name

Now save the file. Go back to phpMyAdmin.

Choose your database table on the left and then click Import on the right.

change domain name

These steps are the same for WordPress and Joomla.

WordPress does offer a way to change the URL of the live site without needing to go into the configuration.php.

Scroll down in the WordPress admin area and go to Settings > General.

Towards the middle of the page you will see an area to type in your site URL.

change domain name

You would still need to do the second step above regarding the database tables in phpMyAdmin.

So now that we have our website live with our new primary domain name and our links are working and images displaying, we just need to get on the same page with Google so that our pages won’t see a dip in SEO.

 

Step 5 to changing your domain name: Redirect EVERYTHING

This is absolutely VITAL!

You want to be sure to redirect all of your old domain’s pages to the new domain’s counterparts ASAP so as not to lose potential website visitors.

Additionally, redirecting will help Google to give credit to the new pages as opposed to removing them from the organic search results when they are brought to a “Can’t Find” page.

This is easy.

 

First, we need to setup the old domain as an Add On.

Login to your cPanel account and go to Domains > Add On Domains.

change domain name

Then type in your old domain’s URL in the New Domain Name field.

change domain name

The Subdomain and Document Root fields will automatically populate.

 

Then we need to edit the old domain’s .htaccess file

Login to your cPanel or FTP account and go to the folder that you just created (under thepublic_html folder).

The name of the folder will be your old domain name (with .com) like above.

Now open the .htaccess file for the old domain.

Add this code anywhere:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^/?$ “http://newdomain.com/$1” [R=301,NC]

That’s all! Now if someone clicks on a link to your old domain, they will be brought to the page on the new domain.

No error page for the USER or for GOOGLE.

And Google will start giving credit to the new domain’s pages.

But don’t sit back and wait for Google to find out about your new primary domain name …

 

Step 6 to changing your domain name: Tell Google

You want to keep Google in the know because:

1) You want them to index the pages on your new primary domain

2) You want a seemless transition for your pages displaying in search results

And Google WANTS to know because:

They may have found your pages valuable in the past and they want to keep sending people to them!

There are 2 places where we are going to tell Google: the Search Console and Google Analytics.

 

Change your site in the Google Search Console

The Google Search Console is a great tool that is often overlooked for SEO.

The Google Search Console is a great tool that is often overlooked for SEO.Click to Tweet

It is usually the first thing that I do when setting up a website or creating a new page.

If you’ve never set it up before, I’m going to walk through the steps. If you have set it up before, there will also be steps here following that will show you how to change the URL address of your property.

Go to the Search Console by visiting google.com/webmasters/tools.

First, you want to Add a Property.

change domain name

Enter your URL.

change domain name

And choose your verification process (if you had Google Analytics in your former domain, the code is still in your files so just use the recommended verification process).

change domain name

Otherwise, the next easy step is to upload the HTML file given by Google to your public_html or root folder and then click verify.

change domain name

At this point, your account is set up and your ownership is verified.

Check my marketing blog later for a complete guide to using the Google Search Console.

Now, once we have set up a new Search Console for our new domain, we can update our previously set up Search Console property.

First, select the property from the drop-down in the top-right of the page, select the drop down for Settings and choose Change Address.

change domain name

You will be brought to a minor checklist where you will select your new address (the property that you just set up), check that the redirect we set up earlier in .htaccess is working properly, and then verify our ownership and submitting the change.

change domain name

You will then receive an email from Google confirming this change request.

It will take a couple of days for your change to take effect.

 

Now, let’s update our new primary domain name in our Google Analytics account

In order for you to be able to make this change, you must have Administrator access to the given property that was already set up for your previous domain.

If you don’t, contact the person who set up the account originally and have them increase your access.

To check, go to the Admin tab in Google Analytics, choose the property for your previous domain, and click on User Management.

change domain name

If you have access to all 4 sections, then you will be able to make this change to your new primary domain name.

change domain name

If you do, go to Property Settings under the Property tab.

change domain name

And change your site URL!

change domain name

That’s it!

What? Were you expecting more steps?

So now we don’t have to wait for Google to find our change – it’s been told and our rankings saved!

Now let’s tie up loose ends.

 

Final step to changing your primary domain name: Update your site across the internet

Yes, we have set up redirects so anyone who clicks on a link to your site will be brought to your new primary domain name.

But, we really should update as many links as we can.

You want people to learn your brand and your website.

You also may decide one day to not renew your previous domain and if you don’t all of those links will be gone.

So, is your URL displayed on social media?

change domain name

change domain name

Local county business directory or chamber of commerce?

change domain name

Online business listing directories such as DMOZ?

change domain name

You don’t need to do this right away, but I would make it a point to get this cleaned up over time.

Think of your branding. Very important part of marketing your business.

Put your correct and new primary domain name as many places as possible.

 

Let’s see where we’ve been …

You decided it was worth exploring a new domain name for your business or brand.

We backed up our information to protect our asset that is our website, then we set up our new primary domain name, restored our files, checked and fixed our links, and then made Google aware of our new site to protect our search rankings.

We are also in the process of cleaning up our URL wherever it’s listed online.

While you do need to set aside ample time to complete this project right, I trust that you will see that it’s not too complicated and no programming knowledge is necessary.

And if you’re still thinking about the possibility of changing your primary domain name, I hope that this guide helped you to seriously consider it!

I recently went through this process myself. I changed my primary domain from tylerernestwillis to tylerewillis because I knew in the long-term I would rather it be shorter … and I never loved my middle name anyway!

Anything can be learned if you put your mind to it!

So …

Congratulations! You’ve just gained a valuable skill!