Blogger blogspot to self-hosted WordPress

Blogger blogspot to self-hosted WordPress

Redirect traffic from old blogspot to the new WordPress

Select simple theme in blogspot.com and disable the mobile version. Click Edit HTML and right after these lines:

 <b:section class='main' id='main' name='Main' showaddelement='no'>
 <b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>
 <b:includable id='main' var='top'>

insert the following lines:

<b:if cond='data:blog.pageType == "item"'>
<b:loop values='data:posts' var='post'>
<script type='text/javascript'>
var new_page='homecircuits.eu/blog/';
var permalink = '<data:post.url/>';
var timestamp = '<data:post.timestamp/>';
new_page = permalink.replace(/homeduino\.blogspot\.[a-z\.]+\/[0-9]{4}\/[0-9]{2}/,new_page);
new_page = new_page.replace(/\.html$/,'');
document.location.href = new_page;
</script>
</b:loop>
</b:if>
<b:if cond='data:blog.pageType != "item"'>
<b:loop values='data:posts' var='post'>
<script type='text/javascript'>
var new_page='homecircuits.eu/blog/';
var permalink = '<data:post.url/>';
var timestamp = '<data:post.timestamp/>';
new_page = permalink.replace(/homeduino\.blogspot\.[a-z\.]+\/p/,new_page);
new_page = new_page.replace(/\.html$/,'');
document.location.href = new_page;
</script>
</b:loop>
</b:if>

That should redirect every post directly to the same post in the new domain (the first part is for blogger posts and the second for the blogger pages). Please change the lines to meet your requirements. I have used “[a-z\.]+” instead of .com, so redirect works for all country domains (not only .com).

To not crawl your old blogs by search engines and to have redirect of the main page insert the following 2 lines between the <head> and </head> tags of your old blog:

<meta content='0;url=http://homecircuits.eu/blog/' http-equiv='refresh'/>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>

After seeing this, search engines should remove your old blog from their cache and the old content will stop existing for them. Therefore they are not going to penalize your new blog for duplicate content (hopefully).

Number “0” in the first line is the number of seconds before the redirect to the new WordPress blog.

In addition I have removed all the widgets, so the blogspot page is now clean. You can do it by removing all the widget blocks like this:

<b:widget id='Attribution1' locked='true' title='' type='Attribution'>
 <b:includable id='main'>...</b:includable>
</b:widget>

After each removal (remove it one by one), save the template (just undo (CTRL+Z if there is any mistake) and check the new rendering in other window. At the end the blogspot looks like this:

blogspot-redirect

All the steps are possible to do in 1 day (or better say 1 night) and now I will monitor the search engine, how long it will take them to take notice migration from blogspot to the self-hosted WordPress 😉 .

Tips in WordPress

It is so easy to split blog into meaningful parts. There are 4 different ways:

  • The More Tag
    • <!–more–>
  • Next Page (Pagination)
    • <!–nextpage–>
  • Page Jumps (Anchor)
    • <a href=”#unique-identifier”>Click me</a>
    • <a id=”unique-identifier”>See?</a>
  • Excerpts
    • The Excerpt module can be found to the left of the post editor, with the other publishing options in your sidebar.