The Goal: Your current blog at abc.blogspot.com is hosted on the Blogger platform but you now want to move this blog from Blogger to WordPress (self-hosted) with a personal domain name (say abc.com).
The Problem: WordPress.org provides an easy option to automatically import all your old blog posts and reader comments from Blogger into your new WordPress blog but there are still some bigger problems that are hard to ignore:
1. Some of your previous articles on the blogspot blog could be ranking very high in search engines for certain keywords but once you shift these articles to a new address, you might lose all that organic search traffic.
2. You cannot use a 301 redirect with Blogger to inform search engines that your site has permanently moved a new web address thus losing PageRank and other Google Juice.
3. Not just search bots, human beings who come to read your old articles via links from other sites won’t know about the new location of those articles unless you manually insert the new links in each and every blogspot article (impossible for large blogs).
4. When you switch blogging platforms, existing blog readers who are subscribed to your Blogger RSS Feed may be lost forever if they don’t manually update their RSS readers with your new WordPress feed address (and most won’t).
5. When you lose RSS subscribers and search engines rankings, the pageviews will drop and that will seriously impact your AdSense revenue in case you are running Google ads.
The Solution: Now that you are aware of the various issues associated with moving sites from Blogger to WordPress, the very good news is that there exists a simple solution to deal with all these problems in one go.
You can quickly and safely migrate any blog from Blogger to WordPress without losing RSS Subscribers or human visitors and there’s also a way to pass all that Google Juice from the old blogspot.com address to your new WordPress blog.
How to Move a Blog from Blogger to WordPress
Important: Before you implement anything, it may be a good idea to run through these steps on a dummy blog first. Also, backup your Blogger blog including the XML template, posts and comments just to be the safe side.
If something doesn’t make sense, just watch the screencast video below (download).
Step 1: In case you haven’t done this already – register a new web domain, buy server space from some web hosting company* that offers PHP / MySQL hosting and and install WordPress software on your new domain.
*This site is hosted on Dreamhost.com but there are other good hosting options like GoDaddy, Blue Host, Media Temple and Knowhost – most services offer one-click WordPress installation so you don’t need the help of a geek.
Step 2: Go to your WordPress Admin Dashboard -> Tools -> Import and select the Blogger option. Authorize WordPress to access your Google Account and within minutes, all your old blog posts and comments will be available on the new WordPress site.
Step 3: Copy this file into your WordPress themes directory and then rename the file from blogger.php.txt to blogger.php. You may use either Putty with wget or Web FTP to access your WordPress themes directory located on the web server. For credentials and other details, check your cPanel.
Here are the contents of that file.
<?php
/*
Template Name: blogger
*/
global $wpdb;
$old_url = $_GET['q'];
if ($old_url != "") {
$permalink = explode("blogspot.com", $old_url);
$q = "SELECT guid FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ".
"ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE ".
"$wpdb->postmeta.meta_key='blogger_permalink' AND ".
"$wpdb->postmeta.meta_value='$permalink[1]'";
$new_url = $wpdb->get_var($q)? $wpdb->get_var($q) : "/";
header ("HTTP/1.1 301 Moved Permanently");
header("Location: $new_url");
}
?>
Step 4. Open your WordPress dashboard and go to Pages -> Add New Page. Keep the title and URL of that page as blogger and select “blogger” from the Template drop-down. Save. There’s no need to add any content to this page.
Step 5. Open the template generator, type the full address of your new WordPress blog (including http:// and the trailing slash) and this tool will create a new classic template for your blogspot blog that will look something like this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="<$BlogLanguageDirection$>"> <head> <title><$BlogPageTitle$></title> <script type="text/javascript"> <MainOrArchivePage>window.location.href='http://labnol.org/'</MainOrArchivePage> <Blogger><ItemPage> window.location.href='http://labnol.org/blogger/?q=<$BlogItemPermalinkURL$>' </ItemPage></Blogger> </script> <MainPage><link rel="canonical" href="http://labnol.org/" /></MainPage> <Blogger><ItemPage> <link rel="canonical" href="http://labnol.org/blogger/?q=<$BlogItemPermalinkURL$>" /> </ItemPage></Blogger> </head><body> <div style="border:#ccc 1px solid; background:#eee; padding:20px; margin:80px;"> <p>This page has moved to a new address.</p> <h1> <MainOrArchivePage><a href="http://labnol.org"><$BlogTitle$></a></MainOrArchivePage> <Blogger><ItemPage> <a href="http://labnol.org/blogger/?q=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a> </ItemPage></Blogger> </h1> </div> </body></html> <!-- replace labnol.org with your WordPress site URL --->
Step 6. Open your Blogger Dashboard -> Layout -> Edit HTML and choose “Revert to Classic Blog”. Copy-paste the template generated in Step 5 in the “Edit Template” area and click “Save Template Changes”.
Your are done. Open any page on your old Blogger blog and it should redirect you to the corresponding WordPress page. On the WordPress side, since we are using a permanent 301 redirect with the redirection URLs, all the Google Juice will probably pass to your new WordPress pages with time.
Update your RSS Feed: When you move from Blogger to WordPress, the address of your RSS feed will change as well. Go to Blogger -> Settings -> Site Feed, type the address of your new WordPress RSS feed here and Google Reader, Bloglines, etc. will automatically move to your new feed. Check this FeedBurner FAQ for some more ideas.
Video Tutorial – Move from Blogspot to WordPress
Now that your new WordPress site is up and running with all the old Blogger posts, here are a few important things you should do:
1. Add your new WordPress site to Google Webmaster, verify ownership and and submit a Sitemap listing the URLs on your new site.
2. When you migrate from Blogger to WordPress, all your pictures and screenshot images hosted on Blogger / Picasa Web Albums will not get imported into WordPress. Therefore never delete your old blogger blog as it will break images that are now embedded in your WordPress posts.
3. Once the search bots and human beings start flocking to your new site, you may update the homepage of your blogspot blog with links to some of your best posts.
4. To know how Googlebot will view your existing Blogspot blog, just turn off JavaScript in the browser and try visiting any of your old blog pages. It’s a single link under H1 that points to your new address that internally does a 301 redirect.
Find this article at: http://www.labnol.org/internet/switch-from-blogger-to-wordpress/9707/
Tags: Archives, blogger, Blogging, google pagerank, How-to Guides and Software Tutorials, import, seo, wordpress, Internet

Reader Comments
This is really helpful tip. Most Bloggers want to shift to Wordpress but are really worried most of times of loosing traffic, readers and google juice.
I think this hack will certainly help all those who are in need of shifting to Wordpress for a better SEO and still maintain everything they have already.
Thanks a lot.
Written by Blogger User on 09.10.09
This is very usefull as i wanted to move my blogger to WP for SEO and ease of use as well. However i am publishing my blogger blog through FTP therefore all my data on google appears to be on domainname.com
However i will be loosing my link structure.. therefore this artilce will help me and many users like me.
Written by Ashish on 09.10.09
@Amit, any exp/idea of how to migrate Blog on WordPress to Drupal ..??
Written by Piyush on 09.10.09
Wow, very complete tutorial. Thank you, I’m using both of them and maybe someday i want to migrate my blogspot pasts to my WP blog..
Written by Taufiq Hasan on 09.10.09
This is a complete round up of things-to-do while performing this task Amit. I learnt this thing in a very easy and step wise manner today, thanks to you for writing this up.
Written by Suneel on 09.10.09
I was thinking about to transfer my blogger blog to self hosted wordpress platform blog. But i was worry about that i will loose my all organic traffic and page rank as well. But this tutorial is awesome. Now i can move my blog. Thanks Amit.
Written by Manish on 09.10.09
Wow!! Amazing post.I have never heard this before.It this really possible.Really an informative post & video too.Thanks for sharing this post with us.
Written by SeoNext on 09.10.09
Excellent, I have just written a post as to why I don’t comment on blogger blogs, and one of the comments left related to losing all the hard work they put into their bloggers blogs. Now all I have to do is work out whether to link from that post, to this one, or to link from a new post.
Written by Sire on 09.10.09
Aren’t you using JavaScript to redirect to new location from blogspot, how will it pass Google juice to new address.
Does Google understand JavaScript redirects?
Written by Dave on 09.11.09
Thank you so much for this guide. I had never set up a redirect before and now everything points to my shiny new wordpress blog! Thank you!
Written by Sean Oliver on 09.11.09
Very awesome tutorial but whats the use of transferring blogger to wordpress. We can also use custom domain in blogger .
Written by Pawan on 09.11.09
Thank you Amit .I was looking for such a solution . But I have a doubt here . The default permalink structure in Wordpress is something different from Blogger .So if I redirect , will the old pages show 404 errors ? .How the above code should be changed if I am moving from a Blogger custom domain to Wordpress .
Written by smartin on 09.11.09
@Dave – The JavaScript is only for human visitors who come to the old site via web browsers. Google and other search bots won’t execute JavaScript and they’ll simple see a single hyperlink pointing to the new WordPress address. Thus, the idea is that all the accumulated juice will slowly pass on to the new WP site.
@Pawan – It depends. Some people want to move to WordPress since it offers more control.
@smartin – You can use any permalink structure on WordPress and this redirection thing will still work because it fetches your new URLs from the MySQL database. For moving a blogger custom domain to WordPress, you might have to make some changes in the Classic Template as it assumes that you are on a blogspot.com domain.
Written by Amit on 09.11.09
Piyush:
Don’t ver go to Drupal, unless you are well vesred with Linus System Administration and little bit of PHP as upgrading and applying patches it is a big headache.
Written by Sabeer on 09.11.09
Wow, I know I should get another blog and least I know now the best way to go about it. Great info, thank you! :)
Written by Gin on 09.11.09
Dear Amit,
It would be more useful if you can add what are the changes we need to make in the classic template for blogs with custom domain, as most of the people who are migrating to wordpress from blogger are the ones with custom domains. including me.
Written by Amal Roy on 09.11.09
great post amit. how can i check how many rss readers do i have???
Written by himanshu on 09.11.09
A similar tutorial is mentioned at
link
Written by Maya on 09.11.09
Nice post, Amit. To add to this, I think you could use rel=canonical too.
Written by Chetan Kunte on 09.12.09
Chetan – The rel=canonical thing only works with pages that are hosted on the same domain or under different sub-domains that belong the same domain.
It is however a good idea to use rel=canonical if you are moving your blog from one blogspot blog to another so the main domain stays as blogspot.com
Written by Amit on 09.12.09
Yes, you’re right. I missed the FAQ part it says link .
Q: Can this link tag be used to suggest a canonical URL on a completely different domain?
A: No. To migrate to a completely different domain, permanent (301) redirects are more appropriate. Google currently will take canonicalization suggestions into account across subdomains (or within a domain), but not across domains. So site owners can suggest ww.example.com vs. example.com vs. help.example.com, but not example.com vs. example-widgets.com.
Written by Chetan Kunte on 09.13.09
Thanks a lot Amit for this useful post.Past few months i was planning to shift my blog blogger to Wordpress.I think i got all my queries answered by this post.Could you please let us know how to improve PR for any blog and how to write effective post?
Written by Niraj on 09.13.09