How to Change Your Domain Name and What Happens When You Do

Recently I embarked on an ambitious renaming of my site.

EnergyFiend.com was a quirky (IMHO) name back in 2005. It was a small (and somewhat juvenile) hobby blog about energy drinks and caffeine.

In the following years I kept on with the site, traffic grew, and I recruited a friend (and former biology teacher) to help with the site. In the last couple of years we slowly transformed the site to something a lot more serious – tracking worldwide caffeine amounts, and collating current caffeine research (risks and rewards).

One morning I woke up realizing the site name no longer fitted (and hadn’t for some time). It was triggered by going to a conference (with my URL on my name tag) and people asking if my site was about  alternative energies and price comparison.

Time to Change the Name

I looked through dozens of alternatives and in the end settled on the (fairly straightforward) name of CaffeineInformer.com

With some trepidation I realized it was going to hurt:

The site was regularly receiving > 500,000 visitors per month, had tens of thousands of backlinks, and one particular page had over 120,000 facebook shares.

However many sites do this, (see the Guardian’s story), and eventually recover and do even better.

Firstly, here’s how I did it.

Step-by-step Changing a Domain Name

LOCAL = my local development machine.

Advertisement

These instructions are for a WordPress site, but could be extrapolated to any other CMS.

  1. Add a new domain to your host account, ensure your domain name registrar is going to the correct nameserver.
  2. Setup new email addresses on new domain.
  3. LOCAL: Setup your new wordpress site (I use a program called DesktopServer, which is a one-click installation of local wordpress sites – no messing around with MAMP and WAMP)
  4. LOCAL: Copy over your theme from where your OLD site theme is, and install any plugins. At this point you would begin working on your theme to do any design changes (in particular new logos and titles etc). You would also fix any places in your theme or CSS that you’ve hardcoded the site URL.
  5. LOCAL: Migrate your data from your OLD live wordpress site. I use a fantastic plugin called wp-migrate-db-pro – you install it on your live and local sites and you can quickly download or upload your wordpress data. It will also take care of changing all internal URLs.
  6. LOCAL: Change the site name under Settings / General.
  7. LOCAL: It’s important at this point to make sure you have all the correct plugins installed locally. It’s okay if they are not all active.
  8. Install WordPress on the NEW production domain. To make things easier, make sure the database name and user are the same as your local (this helps to avoid confusion later on).
  9. FTP upload your theme and plugins.
  10. Using wp-migrate-db-pro migrate up your wordpress database from your local.
  11. COMMENTS: If you use a system like DISQUS for commenting, you can go to the settings for your site, and there is a domain migration wizard. Start this now.
  12. Begin testing your NEW site, be as thorough as you can. If, in any of your posts you have referenced your site name, you could use a plugin like “find and replace” to change this.
  13. Google Webmaster tools – You can request a change of address (see more about moving a site here). Do this BEFORE uploading your redirects because google tries to re-authorize your old site, and if the redirect is in place it can’t do this.
  14. On the OLD site edit your .htaccess with a blanket 1:1 apache redirect. Note that if you have any other old internal redirects (such as Redirect Permanent) they will need to be placed BEFORE this and changed to use RewriteRule, and – obviously – be redirecting to the new site.
    
    RewriteCond %{HTTP_HOST} ^oldsite.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.oldsite.com$
    RewriteRule (.*)$ http://www.newsite.com/$1 [R=301,L]
    
  15. Setup forwarders for email addresses on OLD domain.
  16. Google Analytics: It is possible to change your site URL in the analytics settings, rather than starting a whole new profile. This is a good idea as your retain all your old stats.
  17. Social: You can change your twitter handle name and still retain followers. At this point edit your profile with new brand images and names. On a facebook change you can only change your page name ONCE. After that, tough. You can change your FB page URL.

It’s a big job, and it mostly went well, and there were no major things that went wrong.

But… now for the fall out.

 

1. We Lost All Our Social Share Metrics

On most pages I had customized social sharing buttons that would also display the counts.

On the change over I thought I was being really crafty by changing my code to get the social counts for the OLD url. Then I went to make some more code to add in the social counts for the NEW url.

The outcome was confusing.

It turns out the from the moment I 301 Redirected all the old pages, the various social networks reset all their counts for the OLD url.

To confuse things even further, a query on the OLD url would return the result for the NEW url.

Example: You can check facebook’s counters by using the following URL.

https://api.facebook.com/method/fql.query?query=select%20total_count,like_count,comment_count,share_count,click_count%20from%20link_stat%20where%20url=%27YOUR URL HERE%27&format=json

This was particularly irritating where one page had about 128,000 shares. This was all gone and set back the beginning again. So I pulled my fancy counting code, and no longer display share counts (which is a shame as my a/b testing on social buttons shows that showing the counts can help).

2. Search Referrals Took a Hit… But Recovered

We took a rapid hit, but it slowly recovered.

It was clear (via Webmaster Tools) that many keyword phrases dropped about 4-5 places in the search results. We had some phrases that ranked number one. These were now returning results at around position 5.

This is despite sending a Webmaster tools request for a site name change. Google recommend getting your backlinks changed:

Ideally, you should contact the webmaster of each site that links to yours and ask them to update the links to point to the page on your new domain.

Seriously?

We tried.

The only links we were able to change were those on Wikipedia (these are all nofollow anyway). Even this was difficult: these were all links added by the various editors. When we changed the URLs there was some negative response because it looked a lot like spamming (sigh).

We emailed some webmasters but received only single response out of dozens of attempts.

The End Result

Search Traffic

Search Traffic

Search traffic recovered. It took under 3 months to reach the levels we had prior to the domain change.

One thing is peculiar, mobile traffic recovered much quicker than desktop traffic.

To this day desktop traffic referred from search still does not quite match the levels prior to November last year, but mobile search traffic is now significantly higher.

Hi, I'm James, and for the last decade I've made a living by making my own blogs and websites.
Updated: September 15, 2016

8 Comments

  1. I know this is a few years old, but I did just want to point out… That’s sort of what my graph looks like even when I don’t change domains! I find that traffic starts falling off around the holidays, and doesn’t fully pick back up again until the end of January. All my content is B2B and code-related stuff, so maybe that’s just the nature of it, but I thought I’d point that out. Your recovery actually seems quite quick to me! I’m about to change my domain name and am hoping I can be as fortunate.

    • It’s important to understand seasonal variation in your particular niche. In my case there has never been seasonal variation, this was straight ranking loss from a lot of redirects.

      Good luck with the change!

  2. Hi,
    I had changed my site’s domain on the 31st of December, 2014. It’s almost 1 year gone now and I have not recovered from the drop in google search traffic despite the fact that I followed every single guide on switching of domain.
    As at the time of this comment, I am still loosing as much as 90% of my previous domain’s search traffic.
    I am now thinking of switching back to my former domain after I have done everything I can thing of to salvage my unfortunate situation.
    I lately have a feeling the new domain could have some issues. The new domain had been registered and parked for about a year and half before the switch. I don’t know if it has anything to do with my current predicament.
    Please, what are your thoughts on this?

    • Sorry to hear about this. There could be so many reasons. It could be one of the cluster of algo updates coming from google that has coincided with the recovery. Could be (as you suggested) something odd with the new domain and its historical link profile or reputation.

      I recently did an experiment. I have a site that used to get outstanding rankings, then slowly tanked. I’ve moved a few of the articles off this domain to another domain (with 301 redirect) and these articles IMMEDIATELY started ranking again on a different domain, showing there is something about my domain that Google no longer likes. All very nebulous. Good luck.

  3. Question: I’m working with a nonprofit organization that’s creating a new site and turning their old WP site — which has primarily functioned as a digital magazine — into its own project with a new domain.

    For example, if their domain had organization.org, then they’re moving the existing content to organizationmagazine.org, and recreating organization.org as a totally new site (incidentally in Drupal). But they want to be able to redirect existing links to the magazine content to appropriate URLs on the new domain. I’m wondering, though, with the .htaccess redirect you suggest, wouldn’t that mean that all traffic to the new organization.org site be redirected to organizationmagazine.org? Do you happen to know if there’s a simple way to prevent this, or would they need to set up separate redirect commands for each individual post?

    • Yeah the redirect is a blanket one. If you are still using the old domain, you will need to redirect URLs. If you have any kind of pattern in your URL naming you might be able to setup some fancy Redirects.

      All depends on your existing permalink pattern.

      • Thank you for your article James, it really helped me. 🙂

    • Hi Harris,

      I am having the same problem. I am planning to move my website to a new domain and then use the old domain with a new website I am working on currently. I have been searching the web for some tips on how to deal with this situation, but haven’t found anything yet. How did you solve the issue finally? Many thanks. 🙂

Add a Comment