A canonical rel tag is a snippet of HTML5 code that indicates which URL is the main version if there were multiple duplicate URLs on a website.
This type of tags must be placed in the < head of the > web and must be used only when it makes sense since, although Google says that generally if the canonical URL is respected,it does not always pay attention since this type of tags are clues, not directives.
Rel Canon Label What is it for?
This tag allows you to fix duplicate content issues by specifying the version of a main or canonical web page as part of search engine optimization(SEO).
In this way, the search engine is told the URL that it wants to be crawled, so it does not waste crawl time (Crawl Budget) in URLs that have the same or very similar content.
In the case of Google, it indicates that if there are several URLs with the same content and none of them is canonical, it will be the algorithm that decides which one will be indexed and positioned. Likewise, if several URLs are indicated as “rel canonical”, Google will not take this into account and will index all similar URLs.
Syntax of a canonical label
This is the syntax of a canonical tag in HTML5code:
<link rel=”canonical” href=”https://ejemplo.com/pagina-ejemplo/” />
It is interpreted as follows:
link rel=”canonical”: the URL of this tag is the original version that is the one that wants to be indexed.
href=”https://ejemplo.com/pagina-ejemplo/: This is the URL you want to index.
Google always advises the use of absolute URLs, which is the same as the full address of the website.
Fundamentals of Rel Canon labels
There are five aspects to consider when implementing a canonical tag:
- Use absolute URLs.
- Write URLs lowercase
- Use the correct domain (http vs https)
- Insert self-referential canonical tags (the canonical of a page points to itself)
- Put one canonical tag per page.
Errors when implementing a canonical tag
Adding canonical tags is easy but complicated at the same time if you do not know how to implement them correctly.
These are the most common mistakes to avoid.
- Block the canonicalized URL through the robots.txt file.
- Do not self-reference the canonicalized URLs that go to the home of the web.
- Set the canonicalized URL to “no index”
- Have multiple canonical labels. Google won’t listen to any.
- Insert the canonical tag into the body of the < > web.