How I redirect traffic from blogger pages to wordpress posts

After moving the blog from the blogger to wordpress, my first challenge was to organize the posts for better discovery and search. I have done that by automatically generating tags and tagging posts using a bit of analysis and a bit of insanity.

The next challenge was to redirect the traffic from the old blogger posts to wordpress posts. Thanks to the beautiful wordpress search feature, my job is almost 90% done. The search is really powerful and fetches the correct posts 99% of the time. So instead of setting up either 301/401 redirects or adding complex javascript code or using some kind of mapping [old -> new] mechanism in PHP, all I had to do is to send the traffic from http://chandoo.org/blog/ [archive path] / [post title].html to http://chandoo.org/wp/?s=[post title] and wordpress would fetch and display the post for me.

So I went to my blogger template edit screen and added this piece of javascript code.


window.location = "http://www.chandoo.org/wp/?s= < $BlogItemTitle$ >";

The $BlogItemTitle$ is the old blogger tag for blog post title, which I am passing as an argument to my wordpress search.

How to redirect traffic, visitors, searches from blogger to wordpress posts

Since most of the people visiting the old posts on my blog are coming from search engines this method of redirecting is working perfectly for me. There are few problems though, this works only for post pages, if you have monthly / weekly archives like I do, some people may still visit the archive pages. I am thinking of adding permanent redirects or some PHP script to redirect the blogger archive requests to wordpress archives. But the traffic to those pages is small enough to neglect it for now. Once the search engines catch hold of new URLs I can permanently remove the old blog content from my website.

Feel free to comment incase you need some help in figuring out how to do this for your site.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

5 Responses

  1. @kapil… you can do it with blogspot hosted blogs as well. I guess your blog is hosted on old blogger, if you have migrated to new blogger (which google literally forced everyone to do) then you may have to change the tag “$BlogItemTitle$” .

    In that case, near the blog header in “edit html” section of your blogger settings insert the below script. I havent tested, but i am guessing it should work with little or no corrections.

    SCRIPT

    < b:if cond=’data:blog.pageType == “item”‘ >
    < script >
    window.location = “http://www.kapilb.com/wp/?s= < data:post.title / >
    < / script >

    Oh yeah, you may have to adjust the spaces in that script, I had put spaces to ensure that comment gets published instead of being parsed.

  2. @ankur… hmm, but you may want your visitors to find your site for other purposes also… For example, in my case I want to remove the old archives once most of my readers have updated their bookmarks or when I am getting no further visits to those files.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.