He said “I don’t know if everyone’s seen this but there’s a very important point here regarding canonicals. And it’s the fact Google only checks canonicals on the raw HTML, not the rendered one.” Why is this important, he said you should “make sure your server doesn’t output canonical placeholders that are replaced on render.”
John Mueller confirmed this by saying “We (currently) only process the rel=canonical on the initially fetched, non-rendered version.”
We (currently) only process the rel=canonical on the initially fetched, non-rendered version.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) May 10, 2018
Eric Wu noted a site doing it wrong:
You can insert it, that doesn’t mean it does anything 🙂
— John ☆.o(≧▽≦)o.☆ (@JohnMu) May 11, 2018
So make sure to keep this in mind when implementing canonical tags.
Forum discussion at Twitter.