Blogger To WordPress Traffic & Permalinks Redirection Plugin

Major Update: This plugin’s new version has been released with many **new features **like:

Link: Blogger to WordPress Redirection Plugin


**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.

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:

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:

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


<!--?php
<span class="hiddenSpellError">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]


About Author

Rahul Bansal

Rahul Bansal

I am a geek (wordpress), blogger (tech) & entrepreneur (rtCamp)