Canonical tags from tumblr to our website for posts

691 views
Skip to first unread message

amman....@gmail.com

unread,
Jun 17, 2012, 3:31:40 PM6/17/12
to tumblr...@googlegroups.com

So we built our customized theme using Ruby on Rails (not sure if this is relevant for the questions), and we would like to put in canonical tags for each post that lists the same exact post on our own website's blog as the originator of that content.  Since we will have the same posts on both sites, we want to avoid duplicate content issues with Google and other search engines.  So my questions – is there a way we can possibly put unique canonical tags in place for each post on tubmlr?  If so, how would you recommend we do that and dynamically so we don't have to put one in manually for each one?  In terms of implementation we can work with our developers, but just want to first find out if it's possible with tumblr pages.

Please let me know.

Best,

Amman

amman....@gmail.com

unread,
Jun 17, 2012, 3:42:44 PM6/17/12
to tumblr...@googlegroups.com
Hey there - to provide an example, take any given tumblr post of mine:


I would want to place this in the <head> section:

<link rel="canonical" href="http://my-own-domain.com/unique-post-name" /> 

for the same post that appears on my own website, outside of tumblr.

Is that possible?

Thanks!
Amman

Sean Zhu

unread,
Jun 18, 2012, 5:47:22 PM6/18/12
to tumblr...@googlegroups.com
That doesn't look possible to me. :c

By the way, wouldn't that essentially make Tumblr a mirror for an externally hosted blog? I don't think that in general, many web services are a fan of hosting content that exists elsewhere…

amman....@gmail.com

unread,
Jun 19, 2012, 11:54:08 AM6/19/12
to tumblr...@googlegroups.com
Thanks for your reply, Sean - so are you saying that it's not possible to add your own dynamically-generated meta tags to your tumblr pages if you have a customized theme?

Sean Zhu

unread,
Jun 19, 2012, 1:17:03 PM6/19/12
to tumblr...@googlegroups.com
Basically, Tumblr doesn't allow you to run your own server-side scripts. There are quite a good few reasons why web services like Tumblr would make this decision.

:(

amman....@gmail.com

unread,
Jun 20, 2012, 7:42:48 AM6/20/12
to tumblr...@googlegroups.com
Ok, so then the question becomes, can you insert your own meta tags manually in each post?  Sorry if that's a dumb question - I don't have experience creating customized themes but will be working with a vendor to get that in place if possible.

amman....@gmail.com

unread,
Jun 20, 2012, 7:48:38 AM6/20/12
to tumblr...@googlegroups.com
I meant to say "HTML element", rather than "meta tag" - is it possible to insert my own HTML element manually in the form of this in the head section in a customized tumblr theme for each post individually:

Unique Post Name 1
<link rel="canonical" href="http://my-own-domain.com/unique-post-name1" /> 

Unique Post Name 2
<link rel="canonical" href="http://my-own-domain.com/unique-post-name2" /> 

etc.

felix bonkoski

unread,
Jun 20, 2012, 3:48:33 PM6/20/12
to tumblr...@googlegroups.com, amman....@gmail.com
I'm going to say the answer is "sort of" but "No", not really they way you want.

First, you should know that the "slugs" that come after posts on Tumblr are *not* unique. The only uniquely identifying feature of the Tumblr post is the Post ID.

For example, in the URL:

Then the numbers (123456789) are the Post ID, and the other part ("this-is-called-a-post-slug") is the "Slug". The slug is *not* a unique identifier on Tumblr.  It *could* be unique if Title and Content of every one of your posts is unique, up to however many characters Tumblr will include in the "slug"

These URLs are all equivalent on Tumblr:

To my knowledge, there is no Theme Variable in the Tumblr Theme engine to extract the post "slug".  You can however get the Post ID.  So you could make a link with the *Post ID* like this on Permalink pages:

<link rel="canonical" href="http://my-other-domain.com/{PostID}" />

But as I don't think there is any way to get the "slug" in a {ThemeVariable} I don't think you can do exactly what you want.

There's my two cents.

Felix



--
You received this message because you are subscribed to the Google Groups "Tumblr Themes" group.
To view this discussion on the web visit https://groups.google.com/d/msg/tumblr-themes/-/b2ZsnSxhNEAJ.

To post to this group, send email to tumblr...@googlegroups.com.
To unsubscribe from this group, send email to tumblr-theme...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tumblr-themes?hl=en.

amman badlani

unread,
Jun 21, 2012, 8:47:32 AM6/21/12
to tumblr...@googlegroups.com, amman....@gmail.com
Thanks for your reply, Felix - very helpful!

I think this might actually work, because for our tumblr pages, (1) we do actually have unique "slugs" for each post currently and (2) when you go to any of our URLs with only PostID, they automatically 301 redirect (permanently) to the URL with both PostID and Slug (for both shortened versions, with or without the trailing slash). 

So to be clear, the URL on my-other-domain.com does not need to match the PostID and/or Slug.  So instead of the canonical being this:

<link rel="canonical" href="http://my-other-domain.com/{PostID}" />

I'm fine with it actually being this:

<link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" />

But so then the question remains whether or not I would be able to add the <link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" /> canonical tag manually to the head section of the http://my-tumblr-blog.tumblr.com/post/123456789/this-is-called-a-post-slug post page.  Do you know if that's possible? 

Note: it's important that the <link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" /> canonical tag not be added to the head section of either http://my-tumblr-blog.tumblr.com/post/123456789/ or http://my-tumblr-blog.tumblr.com/post/123456789, since they permanently redirect to http://my-tumblr-blog.tumblr.com/post/123456789/this-is-called-a-post-slug.

Thanks, Felix!
To unsubscribe from this group, send email to tumblr-themes+unsubscribe@googlegroups.com.

felix bonkoski

unread,
Jun 21, 2012, 6:05:42 PM6/21/12
to amman badlani, tumblr...@googlegroups.com
So to be clear, the URL on my-other-domain.com does not need to match the PostID and/or Slug.  So instead of the canonical being this:

<link rel="canonical" href="http://my-other-domain.com/{PostID}" />

I'm fine with it actually being this:

<link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" />

But so then the question remains whether or not I would be able to add the <link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" /> canonical tag manually to the head section of the http://my-tumblr-blog.tumblr.com/post/123456789/this-is-called-a-post-slug post page.  Do you know if that's possible? 

Note: it's important that the <link rel="canonical" href="http://my-other-domain.com/blog/some-other-unique-identifier" /> canonical tag not be added to the head section of either http://my-tumblr-blog.tumblr.com/post/123456789/ or http://my-tumblr-blog.tumblr.com/post/123456789, since they permanently redirect to http://my-tumblr-blog.tumblr.com/post/123456789/this-is-called-a-post-slug.
 
In the absence of a {ThemeVariable} that extracts the "slug", I really can't think of a *clean* way to do this.

Here's my best idea:
  1. Use the Source URL from the post.

  2. For every post on Tumblr you create that is mirrored on my-other-domain.com make sure you set the "Content Source URL" for that post when creating the Tumblr post, and set that source URL to the Canonical URL.

  3. In the header of your Theme Code, do something like this:
<head>
.....
{block:PermalinkPage}
    {block:Posts}
        {block:ContentSource}
            <link rel="canonical" href="{SourceURL}" />
        {/block:ContentSource}
    {block:Posts}
{/block:PermalinkPage}
.....
</head>

Yes, It's OK to include 2 {block:Posts} in your Page! Tumblr will still parse it correctly.  Wrapping the block in {block:PermalinkPage} will ensure this link is only inserted on the post Permalink pages.

However, now every time you set a SourceURL on a post, it will include this canonical link!  So don't set a SourceURL if you don't want this <link> created!

Tumblr just doesn't give you the kind of control you're looking for to embed custom things *directly onto the HTML of the page*,  but hopefully in your situation this will work OK.

Felix

amman....@gmail.com

unread,
Jun 24, 2012, 8:33:35 PM6/24/12
to tumblr...@googlegroups.com, amman badlani
Thanks so much again for your help, Felix!  I'm going to try this out and see if we can get it working.  I'll keep you posted on progress.

Best,
Amman
Reply all
Reply to author
Forward
0 new messages