Blogger – How to Add rel=’canonical’ to Template Header

bloggerheaders

How to add this to a Blogger template header:

rel='canonical'

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'/>

Best Answer

I tried it my self and find the correct code

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

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