Adding rel-canonical to Tumblr themes

Google recently introduced a way to tell their crawler which address variant you want indexed:

Now, you can simply add this <link> tag to specify your preferred version:

<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />

This is very simple to set up with Tumblr. Go to the customization page, and just before the </head>, add the following code:

{block:PermalinkPage}<link rel='canonical'
      href='{Permalink}'>{/block:PermalinkPage}

This will automatically add the <link> element on pages for individual entries. Index pages (i.e. pages that can have pagination links) will just get a blank line.

written 13 February, 02009 Comments