Facebook like button should not use canonical link
开发者_如何转开发I'm implementing the Facebook "Like" button on our site, using the Javascript SDK.
It's working brilliantly, but when a user posts a comment, that message links back to the canonical link in the <head> section.
that's severely unwanted behaviour. Why go through the trouble of manually providing a link to have it overridden?
Anyone know a solution?
No - that's a feature of the Like system.
That's how it knows that a "likes" to disparate-looking URLs are actually to the same resource. It's done this way quite deliberately - and I agree with the implementation.
In short - this is acting as intended. Either dump the canonical link, or implement this differently.
I agree that this should be the behaviour; partly because I can't think of a reason to specify a canonical link that you don't want to use?
I found this question because I had the opposite problem in that my canonical link seemed to be being ignored, so I presume they have fixed this feature in Facebook
For me the data-href attribute overrides the canonical meta tag
<div class="fb-like" data-href="YOU_LINK_GOES_HERE" data-send="false" data-layout="button_count" data-width="45" data-show-faces="false" data-font="lucida grande"></div>
精彩评论