How to add this to a Blogger template header:


I made a mistake with data:post.url, which doesn't work on the header and gives me error message"

<link expr:href='data:post.url' rel='canonical'/>

  • 1
    It's okay to answer your own question, but you need to post a clear, understandable question in the question post and create a separate answer post with your answer. Unless you're trying to answer a different question on here, in which case you should answer that question, not create a new question post. Please read our help center.
    – ale
    Feb 25, 2014 at 3:18

3 Answers 3


I tried it my self and find the correct code

<b:if cond="data:blog.isMobile">
<b:if cond='data:blog.url'>
<link expr:href='data:blog.url' rel='canonical'/>

the code "data:blog.url" retrieve correct Page url in blog I hope this help others . .


This is solely automatically supported by Blogger as it’s powered by Google.

<b:include data="blog" name="all-head-content"/>

You can try

<b:include data='blog' name='all-head-content'/>

I also use it on my blog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.