Moving from Blogger to WordPress: Best Practices
I recently moved a friend’s medium-size blog from Blogger to hosted WordPress (on DreamHost, not WordPress.com), and I thought I’d share a few tips for making the transition smooth.
Background
If you’re interested in why moving your blog from Blogger to WordPress is a good idea, look no further than Anita Campbell’s write-up. Once the birth pains of the transition are over, there are no real drawbacks besides lost PageRank from your Blogger blog—if you published on BlogSpot and can’t transfer that Googlejuice to your new host via a real 301 redirect.
Note: If you’re self-hosting your Blogger blog, check out Maintain permalinks moving from Blogger to WordPress by Justin Watt. If you need to convert from Blogger Beta to Wordpress, check out this tutorial. My tutorial below does not work for Blogger Beta.
Requirements
This is what you need to play:
- A Blogger-driven weblog
- A fully installed version of WordPress 2.0+ (it has the nice import utility)
- A basic text editor - Notepad will do
- Some technical know-how (or an adventurous spirit), because I’m not going to hold your hand
What this will and will not accomplish
- Will redirect visitors no matter what their browser situation
- Will redirect them to the best, most relevant page on your new WordPress blog
- Will not preserve PageRank from your BlogSpot blog to your new blog. This would require a 301 Permanent Redirect and access to the server, not provided by Blogger.
- If you publish using Blogger to a remote location using FTP/SFTP, you may be able to preserve PageRank. However, I’m not going to cover that here. You will need to research 301 redirection from your Blogger server to your WordPress server using 301 redirection.
The menu
Here’s what we’ll be doing today, kids:
- Saving the Blogger template
- Backing up data from Blogger
- Import data from Blogger into WordPress
- Prepare the WordPress host for redirects from Blogger
- Modify the Blogger template to include redirects
- Test!
Some of this is based on a tips page from Quick Online tips.
Step 1: Save the Blogger template
Click the Template tab, highlight the text, paste it into a text editor and save it.
Step 2: Back up data from Blogger
Follow Blogger’s detailed directions on backing up your data. (In essence, you change your template to post a text file of all your entries to the homepage of your site.) It’s a little wonky; I couldn’t get the backup to work with comments, so I just backed up entries.
Step 3: Import data from Blogger into WordPress
This is the coolest step. :) WordPress 2.0 has a straight-up slick import utility for Blogger. Go into the WordPress admin area, select the Import tab, select Blogger as the type of blog you’ll be importing, and follow the directions. Looove it.
Step 4: Prepare the WordPress host for redirects from Blogger
Credit a file in a text editor called from_blogger.php and put the following into it. Wherever there is the text http://www.yoursite.com/blog/, replace it with the root location of your WordPress blog!
This file will take the redirect from Step 5, parse the URL that’s being passed from Blogger, and redirect the user to the corresponding imported entry on WordPress. If it can’t find the corresponding entry, it directs to the root of the blog.
Put this file somewhere on your WordPress host. If you don’t want to modify anything else in this tutorial, put it at http://www.yoursite.com/from_blogger.php.
I owe this section partially to Owen Barder. (I say “partially” because his code had formatting issues and a big typo that I spent a long time trying to debug, and therefore I’m not giving him all the credit. :)
Step 5: Modify the Blogger template to include redirects
Remember the text file with the Blogger template from Step 1? Open it and Save As with a new filename. We’ve got a couple of things to add.
-
Immediately after the opening <Blogger> tag, add the following:
This will redirect to the root of your new WordPress blog if the users come to a main or archive page on your Blogger site. If they come to the page of an individual blog entry, it will redirect them to the
from_blogger.phpscript, where we’ll try to pass them along to the appropriate location in the new WordPress blog. -
Add the following in the <head>:
<meta http-equiv="refresh" content="5;url=http://www.yoursite.com/blog/" />This will redirect folks who have javascript disabled.
-
Add the following helpful text for the non-javascript users who won’t be immediately redirected. This will display as a yellow box that sits above all other content in the top-left corner.
<div style="position: absolute; top: 30px; left: 30px; border: solid 2px #333; color: #000; background-color: yellow; padding: 5px; width: 350px; z-index: 5;"> <p><strong>My blog has moved! Redirecting…</strong></p> <p>You should be automatically redirected. If not, visit <a href=”http://www.yoursite.com/blog/”>http://www.yoursite.com/blog/</a> and update your bookmarks.</p> </div> - Fully republish your Blogger blog.
Test!
It’s always a good idea to test! However, it can be tricky in this situation you’ll be immediately redirected from your old blog to your new blog as soon as your visit, getting the same treatment as your visitors.
To test, first turn off javascript.
- In Firefox, go to Tools > Options > Content > uncheck Enable Javascript.
- In Internet Explorer, go to Tools > Internet Options > Security > Internet Zone > Custom Level… > disable “Active Scripting” (under Scripting).
Now try the following tests:
- Go to the homepage of your old blog. You should be redirected in 5 seconds to the homepage of your new blog.
- Go to the homepage of your old blog. Go to an individual entry page. Turn javascript on. Reload the page. You should be transferred to the corresponding individual entry page on your new blog.
Conclusion
Well, there we have it! We backed up our template and our data first, but then we created the world’s friendliest redirects from Blogger to WordPress so users with bookmarks to old entries get shot right over to the appropriate entry on our new website. Hooray for beer!
I imagine that some of you won’t get this right on the first try, but please try to be self-sufficient before posting questions here. I’ll be very hesitant to even respond. There are lots of other resources on the Web about how to do the Blogger to WordPress migration; I just thought I’d post my experience.
February 10th, 2008 at 5:00 am
iƧ giyim
February 19th, 2008 at 11:37 pm
I’ve discovered an easier way to move your Blogger blog over to Wordpress, automatically redirect your old posts and should not lose your pagerank either.
February 27th, 2008 at 3:37 am
Its cool but will loose the pagerank
February 28th, 2008 at 6:21 pm
Etude du march des fleurs
March 3rd, 2008 at 4:33 pm
Worked for me. Awesome.
March 18th, 2008 at 12:00 am
That is a great walk-through and very detailed. It will be sure to help us bloggers! Thanks for putting in the time and helping with transition. Great Post.
March 25th, 2008 at 8:17 pm
Worked like a charm for me! Thanks!
March 26th, 2008 at 10:22 am
This is very good, but if you can’t get the redirection to work, you have to try something else. I moved from Blogger to Wordpress and had to do it differently, so read my post on it also if this didn’t work for you.
March 31st, 2008 at 3:57 am
Best site! Noaa national weather service lrudg
April 7th, 2008 at 6:48 pm
Thanks for the tips. FYI, you might want to remove the “/blog” from line 2 of the PHP code in step 4. I had trouble with it at the beginning, since my website doesn’t have a /blog directory.
April 18th, 2008 at 3:06 am
I get an error saying:
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “href”.
April 24th, 2008 at 10:14 am
Notebook ve bilgisayar
Very good!
May 7th, 2008 at 4:19 am
Can’t the import option in wordpress do this. I was thinking that this should be a bit simpler.
May 7th, 2008 at 7:33 am
All the big corporations depreciate their possessions, and you can, too,
provided you use them for business purposes. For example, if you subscribe
to the Wall Street Journal, a business-related newspaper, you can deduct the
cost of your house, because, in the words of U.S. Supreme Court Chief
Justice Warren Burger in a landmark 1979 tax decision: “Where else are you
going to read the paper? Outside? What if it rains?”
– Dave Barry, “Sweating Out Taxes”
—————————————————————————————————-
http://xanga.com/edwardodeckerpy