Peter
Peter

Reputation: 1541

Use javascript to inject rel="canonical"

For a reason I can't modify the html head for the rel="canonical".

How to I inject rel="canonical" using javascript and does search engine accept the this type of injection?

Upvotes: 1

Views: 358

Answers (1)

Brad
Brad

Reputation: 163603

You can modify the DOM within the <head> tag just as you can anything else. However, it won't do you much good. Crawlers/bots generally don't run your JavaScript.

Upvotes: 1

Related Questions