Is it completely fine to add rel=canonical
tag outside the head section?
I ran a website audit and the crawler highlighted the issue to have rel=canonical
tag inside the head tag.
Is it completely fine to add rel=canonical
tag outside the head section?
I ran a website audit and the crawler highlighted the issue to have rel=canonical
tag inside the head tag.
https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
The following text is highlighted in the official Google documentation:
If you use a CMS, such as WordPress, Wix, or Blogger, you might not be able to edit your HTML directly. Instead, your CMS might have a search engine settings page or some other mechanism to tell search engines about the canonical URL. Search for instructions about modifying the
<head>
of your page on your CMS (for example, search for "wordpress set the canonical element")
This means that we need to put the codes that I want to notify the Google bot between <head>
.
So in this case, your code should be located between codes.
<head>
<link rel="canonical" href="https://www.example.com/url">
</head>