Skip to main content

Redirecting a Blogger blog

I just moved some posts here from an old Blogger blog that I made many years ago. Now that all my posts are here I wanted to redirect the whole old blog to this new one. Blogger doesn't have a built-in way to do it, but it can be done! Here's how:

First, log into the Blogger console and go to the "Theme" section. There is a "Customize" button with a drop down menu. First, in the drop down menu, select "Mobile Settings", then choose to show the Desktop theme on mobile devices. This will ensure that mobile devices get the redirects we're about to add.

Now, in the same drop down menu, choose "Edit HTML". Right after the opening <head> tag you'll insert some code that will add <meta http-equiv='refresh' ... > tags that redirect every specific blog post, as well as a catch-all redirect for all other pages on your blog. Here's what that looks like in my case, redirecting the old jdarpinian.blogspot.com to the new james.darpinian.com/blog:

    <b:if cond='data:blog.url == &quot;https://jdarpinian.blogspot.com/2013/12/pebble-vs-qualcomm-toq-smartwatch.html&quot;'>
<meta content='0;URL=&apos;https://james.darpinian.com/blog/pebble-vs-qualcomm-toq&apos;' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == &quot;https://jdarpinian.blogspot.com/2014/06/homebrew-oculus-rift-eye-tracker.html&quot;'/>
<meta content='0;URL=&apos;https://james.darpinian.com/blog/eye-tracker&apos;' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == &quot;https://jdarpinian.blogspot.com/2017/04/tensorflow-tidbit-whats-up-with-0-in.html&quot;'/>
<meta content='0;URL=&apos;https://james.darpinian.com/blog/tensorflow-0-in-names-of-variables&apos;' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == &quot;https://jdarpinian.blogspot.com/2017/04/tensorflow-tidbit-incompatible-with.html&quot;'/>
<meta content='0;URL=&apos;https://james.darpinian.com/blog/tensorflow-incompatible-with-expected-float_ref&apos;' http-equiv='refresh'/>
<b:else/>
<meta content='0;URL=&apos;https://james.darpinian.com/blog/&apos;' http-equiv='refresh'/>
</b:if>

There's one specific <b:elseif that matches each blog post by URL, and the <b:else/> at the bottom redirects all other pages. Simply paste that code into your theme and replace all my URLs with yours (make sure to preserve the &quot; and &apos; parts, those aren't part of the URLs). Once you save your change you can test it immediately by visiting blog pages and seeing that they redirect as expected.

I wish Blogger had a built-in option for this using real HTTP 301 redirects, but this method seems to work well enough.


Share: