How To Move Your WordPress Blog To A Different Domain

Before I switched the domain name of this website, I did a fair amount of research into the best way to go about it.

A lot of the various tutorials out there were assuming that I was going to be physically moving the website to a different server. But, that wasn’t the plan. My intention was to leave my site right where it was… but just have a different domain pointing to it. AND I need the old domain to continue to work that way all the backlinks out there didn’t break.

So, even though I wasted several hours going in circles and researching this, I found that the actual procedure was fairly simple.

Here’s how I did it, posted in the hopes it saves others some time.

#1 – Secure New Domain And Park It

I bought my domain at Namecheap. Then, I routed the name servers for it over to my existing hosting account. I set the domain up as a “shared” domain, so that it points to the same IP address and server space as DavidRisley.com.

For a little more about buying domains and dealing with name servers, you can watch the step #3 video on my tutorial, How To Set Up A Blog.

#2 – Update WordPress Options

There are two fields in the options for WordPress which contain the URL of your site. Both of these need to be changed to your new domain name. While there are a few different ways to go about it, the way I did it was to add the following two lines to the wp-config.php file for WordPress.

define('WP_HOME','http://www.blogmarketingacademy.com');
define('WP_SITEURL','http://www.blogmarketingacademy.com');

Obviously, change the domain to whatever one you’ll be using.

#3 – Re-route Your Old Domain Via 301 Re-direct

A 301 redirect is is a type of URL redirection that tells the search engines that the link has indeed changed and that it needs to index the new version.

Now, at this point, the new domain should be working fine and points to your current blog. After all, it is parked atop your old domain. So, essentially, BOTH domains are pointing to the same blog. You don’t want to leave it that way, however, because it could lead to potential penalties for duplicate content.

What you want is that all calls to the old domain get re-routed to the new domain. So, in my example, I want all calls to davidrisley.com to actually be re-directed to blogmarketingacademy.com.

I did this through a quick modification to the .htaccess file. The .htaccess file is a hidden configuration file (usually located in the same root directory where WordPress is installed) that tells Apache (the server software which powers much of the Internet) what to do.

The typical .htaccess file for WordPress (if you’re using permalinks) looks something like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I altered mine to look like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.davidrisley.com$ [OR]
RewriteCond %{HTTP_HOST} ^davidrisley.com$
RewriteRule ^(.*)$ http://www.blogmarketingacademy.com/$1 [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I bolded the 3 new lines that I added. All this does is detects calls to davidrisley.com and simply redirects to blogmarketingacademy.com as a 301 redirect.

You can edit your .htaccess file in any FTP program. In some cases, the file may be hidden. Usually, you can look around in the options of your FTP program to enable the listing of hidden files.

#4 – Search and Replace

Next, you want to replace instances of your old domain inside your database and rewrite it to the new one. For example, any of your links to your own posts – INSIDE YOUR POSTS – will still be pointed to the old domain. Now, the 301 redirect you just set up will ensure those links actually work. BUT… it is still best to fix them so that you’re properly linked up internally.

By far, the easiest way to take care of this is to use the Velvet Blues Update URLs plug-in.

Just enter the old URL, the new URL, then the places you want to search/replace. The whole process is taken care of automatically.

Obviously, don’t run an operation like that without backing up your database first. For this, I use and recommend BackupBuddy. Fantastic plug-in.

#5 – Update Feedburner

One of the conveniences of routing your RSS feeds through Feedburner is that you can simply re-direct your source feed without changing the URL of your public feed. If you don’t use some kind of in-between solution, then changing your blog’s domain would mean that all of your RSS subscribers will think your blog simply died.

So, if you are using Feedburner, you’ll need to log into your account, click on the RSS feed for your blog, then click on “Edit Feed Details” at the top of the screen. There, simply change the source feed URL to your new domain name.

Your RSS subscribers won’t notice even a blip.

#6 – Regenerate Sitemap

This step is only necessary if you are using an XML sitemap for search engines. I use the Google XML Sitemaps plug-in. Nice and easy. But, now that the domain has changed, you’ll want to do a manual re-build of the sitemap.

The plug-in has a button to rebuild. Just smack that button and it will do the deed and report to the search engines. Done deal.

.

That’s about it. The only other thing I had to do was change my URL for the Disqus profile on this site… but if you’re not using a third-party commenting engine like Disqus, you won’t have to worry about it.

But, it works. In fact, right after all this was done, I watched the “Spy” view on my Clicky Analytics to watch real-time traffic to the site. And, sure enough… my Google search traffic kept coming right on in. There wasn’t enough time to get re-indexed yet, but it tells me that all of that davidrisley.com traffic was being re-directed properly.

The jury is still out on what happens to traffic after this. I can tell you that, after a week, we did see a decline. But, I expect it will recover in time. :)

 

Like This Post? Join Our Private Newsletter (it's free):

Your Email:

Want Technical Help With Your Blog?
What if you could work on your business, rather than fighting Wordpress?

HelpYou can sit around paralyzed by your lack of tech knowledge, or you can grab a life-line.

David offers a tech workshop where he hand-holds people through the various technical hurdles of using Wordpress. He'll answer your questions, and put his technical experience to work for you.

The goal? You being able to work on your business, rather than fighting annoying technical problems.

Comments

  1. Thanks for the clarity on this. I always get asked this question, and its a lot more technical than a small chat can answer. I usually just hire out to get this done, but for those on a budget, this post outlines it all! Thanks!

  2. Campbell says:

    Good morning Dave,

    I do not know if this will be applicable in this instance but, I am going to make this suggestion so that you do not find out about this the hard way and pull your hair out if and when it happens trying to isolate the source of the problem.

    My direct experiences with WordPress .htaccess is that for some reason it gets handled differently than most .htaccess files in the sense that any modifications done within the main wordpress .htaccess get written over if you update your “Permalink” settings.

    As you know, at some point down the road, you may install a plugin that requires a refresh of the permalink settings and you may potentially get that edit that you have just done overwritten back to the default wordpress .htaccess.

    Like I said, I don’t know if this is applicable in this particular instance but I personally just went through this scenario when redirecting the default WP FEED to FeedBurner and I installed a plugin that required that I refresh my permalink settings and it did overwrite my edits with the wordpress .htaccess file.

    So the long and short of this is that you should test this scenario out later on this evening and see if it does this Dave. More than likely you will need to put the redirect outside of the  default wordpress  gig. Just make sure that it is above it or else it will never fire off.

    xxxx…..htaccess edits …..xxx

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    • I never have WP write the htaccess for me. I always just copy/paste the stuff it gives me and manually edit it. Also, to give WP ability to edit htaccess, you’d need to have write permissions on your blog’s root directory… which isn’t a good idea for security reasons.

  3. Nice info, I know I’ve looked for this type of update in the past. I’ll be sharing with my social and newsletter peeps.

  4. Fantastic article David, however I have a small question for you, when do you actually know that the new domain name has finally been indexed by Google?

    And, could it bring any google penalties if you decided to place something else on top of your old domain?

    Thanks in advance!

  5. Something that always trips me up when changing domains for clients is cache plugins, always remember to clear down the cache info too.

  6. I don’t think wordpress i not a good CMS however if anyone want to move his blog to different domain then your points are very important and effective to understand its functions.

    • I am so enlightened after reading your comment. I’m happy to take the time to understand your functions, Mrs. web development services.

      • Tstarkey says:

         Well said David! Wonder if you’ll get an answer.  I would like to understand the functions too …
        Good article by the way.

  7. Awesome tips! I think the 301 redirect is the most important part of it all, without it everything falls apart. Sort of. :)

  8. The 301 direct is extremely important. I’m a huge believer though in having multiple domains with 301′s directing it. Domain names are a huge ranking factor!

  9. please david i want to move from a freely hosted blog to a self hosted blog how do i do that?

  10. please david i want to move from a freely hosted blog to a self hosted blog how do i do that?

  11. Thanks for sharing on this subject. I’m looking for the best way to change the domain name for a site.

  12. This is great advice for us. However, what if you want to keep your old domain name.

  13. hey David, I’m about to do this move over. Now my old blog is on one hosting and my new one is in another.

    My question is, once I make the move, can I delete the old blog, since I’m not going to be using the old hosting anymore, I will obviously lose that date.

    At the end of the day all I want is to keep my old blogs backlinks and make sure it redirects to the new blog.

    Thanks homie…

  14. I’ve encountered this way too many times. I think the first step is letting your readers know that you will be moving in advance then doing the necessary steps in order to make sure that they will continue to follow you around. 

x

10 Mistakes You May Be Making Right Now With Your Blog


How To Avoid 10 HUGE Mistakes Most Blog Owners Are Making Without Even Knowing It!


Join our private newsletter, and get a complementary copy of Blogging Gone Wrong.

Email:

testing