Sunday, 29 April 2012

// // Leave a Comment

How to Migrate from Blogger to WordPress blog - Complete Guide


Recently, blogging industry viral-ed with tough competition. Current condition implies that even five year old child can create his own blog with free blogging services like Google's Blogger. Well! I'm not dominating or criticizing, but maintaining or running blog successfully is not such easy task as it needs lots of efforts and mind-stress. Though if you successfully dealt with blogger's blog and need to grow up for tasting professional blogging platform then you need to somehow migrate from Blogger to WordPress.

How to migrate from blogger to WordPress blog
WordPress blogging platform has its own benefits. One of the biggest drawback of Blogspot is you can't sell your blog as you are working on behalf of Google, while in self hosted WP blog you are completely free to sell the website.


Benefits of self-hosted WordPress Blog :



  • Complete rights and admin-control

  • More Search Engine Optimization Friendly

  • Access to tons of free professional themes

  • One touch Plugins and Widgets Access

  • More functionality and flexibility



Its not over, cons and pros is infinite, but I can't linger my article describing features of WP blog, so we were on migrating from Blogspot to WordPress.


How to Migrate From Blogger to WordPress Blog - Complete Guide


For successful migration of Blogger to WordPress, you need to follow each and every steps very carefully with full attention, tutorial starts here :


Requirements :



  • Top-Level-Domain (like .com, .in, etc)

  • Web Hosting (for self hosting your new blog)



Our Goal & Specifications for Migration :



  • We will do 301 redirection - Its very important

  • We will follow Same Permalinks

  • Please don't delete Blogspot blog after successful migration



Note : Here its assumed that you already have installed WordPress blog and your domain's name-servers points to new blog


1. Change permalinks in WordPress blog :



From WP dashboard settings > Permalinks > Choose custom structure > and copy/paste below below permalink :


/%year%/%monthnum%/%postname%.html


2. Import Posts including images and comments :



Into your WordPress Dashboard > Tools > Import > Blogger > Activate the Plugin > Grant Access > Import Posts










migrate from blogger to WordPress blog
Click to Enlarge

By following above path you will be able you import all your Blogspot's post to new WordPress blog along with images, comments, tags, labels, etc


3. Setup Redirection :



In order to set up redirection you need to create blogger.php file , including the below code :


<?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");
}
?>


i) In your Computer, open text editor and copy/paste above code into in, and rename the file as : blogger.php


ii) Now access the ftp account (in web hosting panel) and browse into your current WP theme folder, now upload : blogger.php here



  • It follows :  wp-content >themes > theme name > blogger.php



iii) Now name create new page in WordPress and name it Blogger, then change the attributes (right hand side) to Blogger and publish it. (Please refer below images)










migrate from blogger to WordPress blog
Click To Enlarge

migrate from blogger to WordPress blog

4) Finalizing Redirection :



i) Now log on to Blogger account and reach "Edit Template" section, then scroll below and click "revert to classic theme" to see new code their


ii) Its time to copy below code and paste it in that "Edit template" section. (Make sure to replace yoururl.com to your current new domain)


<!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://yoururl.com/'</MainOrArchivePage>
<Blogger><ItemPage>
window.location.href='http://google.com/blogger/?q=<$BlogItemPermalinkURL$>'
</ItemPage></Blogger>
</script>
<MainPage><link rel="canonical" href="http://yoururl.com/" /></MainPage>
<Blogger><ItemPage>
<link rel="canonical" href="http://yoururl.com/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://yoururl.com"><$BlogTitle$></a></MainOrArchivePage>
<Blogger><ItemPage>
<a href="http://yoururl.com/blogger/?q=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a>
</ItemPage></Blogger>
</h1>
</div>
</body></html>


iii) Now save the template, Bingo! you are done with migrating from Blogger to WordPress Blog.


Its time to check your current WordPress blog, I hope every thing seems perfect and works well. If you found any error then please let us know via comment and we will be happy to oblige you for migrating blogger blog to WordPress blog

0 comments:

Post a Comment