301 redirect

So let’s say you’ve got a blog (or 3) that you’ve been posting on for a year or more. Then one day you decide, wow I’ve got another domain name where I’d prefer to keep all of this content. You’ve only got one problem …

How do you move the posts from one domain name to the another?

Keeping in mind that I’m not a wordpress (or computer tips) “expert” … in fact my wife Ana usually finds it terribly entertaining whenever I try to “fix” something on one of our computers … I think I’ve been relatively successful in transferring my blogs over the past week or so. Some of the content from my alohateam.com domain is already indexed in google with the candlemonkey.com url.

Again, there may be some better and/or easier ways. But, here’s how I moved my blogs

Export pages and posts from your old blog

The first thing I would advise in this step is to “clean up” your old blog. Go through all the posts and pages, and delete anything that you don’t want to transfer to the new blog.

Once this is done, simply going into your wordpress dashboard, and under the Manage tab, click on export. The page will look something like this:

wordpress export

And the file you download to your computer something like: wordpress.2008-08-04.xml

Importing pages and posts to your new blog

Bringing the posts into your new blog, is also relatively simple. Just go to the importtab on your blog management dashboard. Choose “wordpress” from the menu of blog types. Browse to the .xml file(s) that you just downloaded from your old blog. Click Upload file and import.

Congratulations, your old content is now on your new domain.

But you’re not nearly done yet …

Cleaning up in-post links

Ugh, this part was not fun. If you’ve been practicing good SEO and generously linking to your older posts; you’re going to have a whole lot of content with links to your old domain(s) … which you don’t want.

You’ll need to go through each post, and change all the internal links to point at the url with your new domain in it.

There is an upside to this though …

As you go through the posts looking for bad links, you’ll also have an opportunity to make sure that they are in the right category, are properly tagged, and if you haven’t done so already, this might also be a good time to add post excerpts and unique meta titles/descriptions.

One area that’s easy to overlook is self-trackbacks in your comments. Especially if you’re using any sort of related posts plugin, I’d recommend just deleting these trackbacks; and for any future posts, installing a plugin such as no self pings.

Redirecting the old urls to your new domain

If you’re using a host such as hostgator which has apache servers, these methods should work for you. If your host uses a different type of server, I’d suggest a quick google search, and/or contacting their support section.

If your old blog and new blog have the same permalink structure:

Lets say you’re moving a post from:
http://alohateam.com/the-shaka-sign/
to
http://candlemonkey.com/the-shaka-sign/

The move will be pretty easy. You just need to set up a site-wide 301 redirect by adding a few lines to your .htaccess file (should be found in the root of your directory). Here’s what the code will look like:

htacess retirect

The first 3 lines at the top are the redirect. And obviously, you’ll replace candlemonkey.com with your new domain name … lol, unless you want to redirect all your traffic to my blog ;-)

If your old blog and new blog DO NOT have the same permalink structure

Ok, so what if your old blog’s post looks like:
http://successwithtodd.com/2007/12/09/3-reasons-why-failure-is-good/
and you’re moving it to
http://candlemonkey.com/3-reasons-why-failure-is-good/

Obviously, the .htaccess redirect we used above won’t work … you’ll just end up with a bunch of 404 errors. Now there’s probably an easy way to change that code to make it work … but I’m too impatient to search for it.

So, I just used a wordpress plugin called Redirection, which sets up the 301 redirects for me.

Once you’ve installed and activated the plugin, just go to the Manage tab on your dashboard, and click on Redirection. You will come to a screen that looks like this:

redirection

Simply put the old url in the top blank, the new url just below it, and click Add Redirection

Unfortunately, you’ll have to do this for each of the urls you want to redirect (it took me a couple of hours to redirect success with todd). I found that the easiest way to get all the urls is to just go to your sitemap.xml file (hopefully you had one), and copy and paste.

Redirect your feed(s)

The last step I took was to redirect my feeds. Since I use feedburner, this was also relatively painless. I just went to feedburner; clicked on my Success with Todd feed; then clicked on Edit Feed Details.

feedburner panel

Once there, I just changed the Original Feed from:
http://successwithtodd.com/feed
to
http://candlemonkey.com/feed

Now, everyone who was subscribed to Success with Todd will get my posts here at Candlemonkey.com.

Well, that’s about what I have to say on this subject.

lol, this post has taken me around 3 hours to write (I gave up my Saturday online poker tournament). As such, I hope that my time has been well spent, and that you find some of this information to be useful.

Aloha til next time,
Todd

p.s. if after a couple of months you realize this was not a very smart idea, just follow the above process in reverse.
;-)


Tags for this post: , , , ,

Recent Posts