Home SEO Google Explains How To Inject Canonical Tags Using JavaScript

Google Explains How To Inject Canonical Tags Using JavaScript

0
Google Explains How To Inject Canonical Tags Using JavaScript

Google has up to date its JavaScript website positioning assist doc so as to add a brand new part on find out how to correctly inject canonical hyperlink tags utilizing JavaScript. The doc says Google doesn’t advocate utilizing JavaScript for this, nevertheless “it’s doable to inject a rel=canonical hyperlink tag with JavaScript.”

The assistance doc provides that “Google Search will decide up the injected canonical URL when rendering the web page.”

A be aware Google made is that “when utilizing JavaScript to inject the rel=”canonical” hyperlink tag, make it possible for that is the one rel=”canonical” hyperlink tag on the web page. Incorrect implementations may create a number of rel=”canonical” hyperlink tag or change an current rel=”canonical” hyperlink tag. Conflicting or a number of rel=”canonical” hyperlink tags might result in sudden outcomes.”

Here’s a code instance of how to do that:

Beforehand, as Google is doing now, Google warned towards doing it this manner however did say it might probably work.

Discussion board dialogue at Twitter.

LEAVE A REPLY

Please enter your comment!
Please enter your name here