Sep 19 2012
Maintaining Search Engine Rank When Moving From Blogger To A Self-Hosted WordPress Blog – 3 Easy Steps
Note:
These instructions are meant for bloggers who are comfortable with using an FTP program to upload files to their web servers. If you’re uncomfortable with this part, get a tech-savvy friend to help you and give him/her these instructions.
If you’d like to learn more about FTP and how to use it, go here: What is FTP, and how do I use it to transfer files?
Assuming you’re familiar with FTP, you should have no problem following the instructions below.
First, you’ll need to have Imported your posts from Blogger into your new WordPress site. If you need help with this part, my inexpensive book Moving Your Blog: How to transfer your blog to your own personal domain name and server from Blogger/Blogspot or WordPress.com can help.
Why This Works
This little tip makes use of an “HTTP/1.1 301 Moved Permanently” header to inform browsers and search engines of your blog’s new location. Search engines and others may still link to the old location for some time, but when they update, your new location will keep its rank because each pre-existing post will be recognized as the same page by search engines.
It’s kind of a big deal if your blog was already popular, and possibly the number one reason folks are scared to move their blogs.
Step 1
First, create a file with the following contents and save it in your Theme’s main folder as “Savage_Lullabye.php”. The folder will be in “/wp-content/themes/” and will be named for your theme.
<?php
/*
Template Name: Savage Lullabye 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 2
Then create an empty Page that uses your new Template:
Step 3
Then go into your blogger dashboard under “Template”, scroll to the bottom and choose “Revert to classic template”, then in the “Edit Template HTML” box, paste in the following code:
<!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://YOUR_SITE_URL_HERE.com/'
</MainOrArchivePage>
<Blogger><ItemPage>
window.location.href='http://YOUR_SITE_URL_HERE/blogger/?q=<$BlogItemPermalinkURL$>'
</ItemPage></Blogger>
</script>
<MainPage><link rel="canonical" href="http://YOUR_SITE_URL_HERE/" /></MainPage>
<Blogger><ItemPage>
<link rel="canonical" href="http://YOUR_SITE_URL_HERE/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://YOUR_SITE_URL_HERE"><$BlogTitle$></a></MainOrArchivePage>
<Blogger><ItemPage>
<a href="http://YOUR_SITE_URL_HERE/blogger/?q=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a>
</ItemPage></Blogger>
</h1>
</div> </body></html>
Replace YOUR_SITE_URL_HERE with your WordPress site URL.

I’ve compressed elements of several screens in order to show you what to look for on each.
That’s it! You’re done!
Anybody who tries to get to your new site will be redirected to your new blog from now on, and search engines will eventually update their listings to reflect your new location without negatively impacting your page’s rank.
The world will forever after be a good and happy place and you’ll blog happily ever after. The end.
Alright, that’s a bit much – but you get the idea.






![A History of Social Media [InfoGraphic]](http://netdna.copyblogger.com/images/history_of_social_media.jpg)



