Important Update: We now offer Blogger to Wordpress migration paid service where we personally take care of everything. Click here for details and free quotes!


Update: This plugin maintains permalinks but in case you want to preserve Google Pagerank and other search engine ranking, please read this new complete tutorial first.


movebloggerwordpressIf you have imported your blog from blogger (blogspot.com) then you might be redirecting visitors from your old blogspot blog to your new wordpress blogs HOMEPAGE. While this approach ensures that you get all the traffic redirected from your old blog to new blog, a visitor may feel lost! What if a person is referred to your old blog via search engine or other link listings?

So this plugin just takes care of this part. It checks for which post people were looking on old blog and then redirect them to same post but on new blog! See following picture which will give you brief idea about what you can accomplish using this plugin…

image

This plugin assumes following things:

  • You used wordpress blog importer while importing your blogspot beta blog.
  • You put redirection code in your old blogspot blog. An example of code is attached below. I strongly recommend using it only.
  • You have imported only one blog. In next version I will remove this restriction so that you can import (or say merge) two or more blogspot blog into one new wordpress blog.

Installation (Blogger Blogspot Part):

  1. Log into your blogger account.
  2. Select old blogspot blogs template/layout. If you are using new custom layout, use “Revert to Classic Template” option on Edit HTML.
  3. Go to “Edit HTML” tab.
  4. Put following codes there with one important change and save changes.

(Important: Replace http://www.devilsworkshop.org/ in following code with your wordpress blog URL)

<html>
<head>
<script LANGUAGE="JavaScript">
<!--
window.location.replace("http://www.devilsworkshop.org/");
-->
</script>
<noscript>
<meta http-equiv="Refresh" content="10; URL=http://www.devilsworkshop.org/"/>
<meta http-equiv="expires" content="10"/>
<meta name="Description" content="301 moved permanently"/>
<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW"/>
<META NAME="GOOGLEBOT" CONTENT="NOINDEX, FOLLOW"/>
</noscript>
<title>301 moved permanently</title>
</head>
<body>
<center>
<h1>Devils Workshop</h1>
<p>has been moved to new address</p>
<a href=" http://www.devilsworkshop.org"> <h1>http://www.devilsworkshop.org</h1></a>
<p>Sorry for inconvenience... </p>
</center>
</body>
</html>

Installation (Wordpress Part):

  1. Click here to download Blogger To Wordpress 1-2-1 Redirection Plugin. A file rbBloggerToWordpress.zip to your PC. Unzip it.
  2. Upload rbBloggerToWordpress.php into ‘wp-content/plugins’ folder.
  3. Go to plugins option under wordpress’s Admin panel. You will see a “Blogger To Wordpress Redirector” Plugin Listed there. Blogger_to_Wordpress_redirector
  4. WAIT! Do NOT click Activate. First Click Edit.
  5. On next screen put your old blogspot blog address next to $oldBlogURL variable! For ease search rb286.blogspot.com and replace it with your blogspot address. Sorry for this manual work, I will automate this step in next version.
  6. Then click Update File link their to save changes.
  7. Go back to plugins page and this time Activate the plugin!

That’s it! This plugin will now onwards map your old blogspot post to new wordpress posts on 1-to-1 basis.

Known Issues:

  • Popular desktop blogging client Windows Live Writer stops working if you use this plugin. But there is temporary workaround. Disable the plugin & paste following code into current templates index.php [i.e. Main Index Template] before everything else! [Path: Admin Dashboard >> Design >> Theme Editor]

#Code: [Note: Replace rb286.blogspot.com with your old Blogspot address]

<?php
$oldBlogURL = "rb286.blogspot.com";
$ref = $_SERVER['HTTP_REFERER'];
$refarr = explode("/", $ref);
if ($refarr[2] == $oldBlogURL ){
  $bloggerurl = '\/'.$refarr[3].'\/'.$refarr[4].'\/'.$refarr[5];
  $sqlstr = " SELECT wposts.guid FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'blogger_permalink' AND wpostmeta.meta_value = '".$bloggerurl."' ";
  $wpurl = $wpdb->get_results($sqlstr, ARRAY_N);
  if ($wpurl){
      header( 'Location: '.$wpurl[0][0].' ') ;
      exit;
  }
}
?>

Example :: How this plugin works?

First note that,  there are two parts – blogger part and wordpress part.

Also for the sake of simplicity lets assume old.blogspot.com/cool-post is mapped to new-wordpress.com/cool-post

Now observe journey of a user…

  1. User requests old post – old.blogspot.com/cool-post
  2. old.blogspot.com send user to new-wordpress.com.
  3. Now at new-wordpress.com, second parts get activated as visitor is coming from old.blogspot.com.
  4. Second part checks for HTTP Referrer information from where it finds URL of old.blogspot.com/cool-post.
  5. Using this information second part at wordpress finds new-wordpress.com/cool-post and sends it to browser.

In fact, the whole process is so transparent that if a user have address bar disabled he will never notice any sign of redirection process. ;-)

About Javascript code at blogger end… its for non-standard browsers who don’t respect meta tags.

About NOINDEX FOLLOW, it tells crawler not to index blogspot page but FOLLOW redirect. Also NOINDEX will instruct crawler to drop already indexed version of page. We need to use NOINDEX because new wordpress post have same content as old blogspot post. This is to ensure that we explicitly handles duplicate content problem.

Let me know if I am missing something as this is my first wordpress plugin.

Credits: I am grateful to Charles and Live HTTP headers firefox extension for their help while coding this plugin!

[Updated: 2008, July 20 - After my  Jimmy's comment]