The canonical url is a jargon well known to webmasters and html professionals. Its use is strongly recommended in certain cases, but before that, what is it for and when should it be used? Find out all you need to know about it, because it positively influences the SEO of your website.
The canonical url is the official address assigned to a web page. In other words, it is the address of content that is indicated to crawler robots as the one to index. So if other pages on your site or another site copy your content, crawler robots ignore it. They are content only to index, and therefore to include on the web, the content published under the canonical url. This avoids having duplicate content.
We also use the terms “Rel canonical, web meta canonical, canonical tag or canonical tag” to designate this url.
Table of Contents
- Why use a canonical url?
- What does a canonical url look like?
- The canonical tag with Yoast SEO
- When to use the canonical url?
- What is the difference between canonical url and 301 redirect?
- Beware of errors when using the canonical url
Why use a canonical url?
To optimize the ranking of a site, crawler robots take many parameters into account. Among them is the web address or url of the page and its content. Logic dictates that unique content corresponds to a url, But it’s not always the case. It happens that we come across duplication of content, that is to say different urls displaying the same content.
For crawler robots, this is a more than valid reason to penalize duplicate pages, but the penalization implies that the pages found at fault are expelled from the web.
If the said penalized pages belong to dishonest copiers, this is not a problem. On the other hand, if the source page which has been the victim of plagiarism is also penalized (and this is unfortunately the case), the webmaster who owns the source will have invested his time and, sometimes his money, unnecessarily. To avoid such injustice, the use of the canonical url is recommended.
To Understand Better about canonical Tag & Duplicate Content refer to following points;
- It should be understood that when the spiders come across identical content, they have little means of verifying the authorship of the content. If the authorship is clear, only the copious pages are penalized. The only problem is that it is difficult to determine it and the source is being unfairly penalized.
- Sometimes the plagiarism is internal to the same site. This is often the case on an e-commerce site when the product sheets are quite similar. In this case, the person in charge is the owner of the site.
- But it can also happen that plagiarism is external when another site simply steals your content or copies part of your content without citing the source. In this case, it may be a trick of Negative SEO, that is to say, on purpose to generate duplicate content for the competitor in order to make him fall in the ranking. Unfortunately, such practices do exist and some even use tools to steal other people’s content.
- Whether the duplicate is internal or external, the canonical tag is the preferred solution to avoid any form of duplication. Thanks to it, crawler robots are well informed that it is this address that must be indexed. They therefore do not risk detecting duplicate content since all other duplicated content will be automatically assimilated to the canonical url. Even unscrupulous thieves will have no complaints, and their attempts will only fail.
If robots hate plagiarism so much, it’s because crawling similar content is like repeating the same job. Not only is this unnecessary, but indexing pages of the same content only clutters their servers. This is also a very bad point for digital ecology, because redoing the same job twice consumes energy unnecessarily, not to mention the energy required for the server to store duplicate pages.
What does a canonical url look like?
It is a url like all the others, but in which we will insert the canonical tag. To do this, you have two options:
- Declare the tag in the .htaccess file at the HTTP header level:
In this case, the canonical tag to insert takes this form: Link: ; rel = "canonical"
Once inserted, the canonical url takes the following format: Link: https://www.cyberindeed.com; rel = "canonical"
It is always advisable to write the url in absolute, that is to say with the http: // or the https: //.
- Declare the tag in the HTML code at the head tag:
In this case, the tag to insert takes the following form: <head> ... <link rel = "canonical" href = "URL" /> ... </head>
Once inserted, the canonical url of the page takes the following form: <head> ... <link rel = "canonical" href = "https://www.cyberindeed.com" /> ... </head>
It should be noted that in this second case, the tag must be inserted in the head and not in the body.
The canonical tag with Yoast SEO
To insert a canonical tag, we have just revealed to you, above, the two possible options. However, if these techniques seem a bit too technical, you can use the Yoast SEO plugin if and only if your site is edited under WordPress.
Once the plugin is deployed (it is located at the bottom of the text editor, where we fill in the metadata), you will have the canonical url field. You just have to indicate in the appropriate field the canonical url which must point to the page you are editing. If you leave it blank, the page url will be the permalink issued by default.
When to use the canonical url?
Since you are never safe from content theft, the ideal is to use it for all your pages. But you can also just insert it when you feel it is really necessary. This is the case when:
- You wish display a product or content in two different categories of the site. This content will therefore only keep a single address, even if it is displayed in different categories. This avoids duplicate content internally.
- You set up filtering and sorting systems on your e-commerce site: since a product can appear following different filters, the canonical tag prevents you from having duplicate content since the product will only have one canonical url visible to you, any filter corresponding to it .
- You want to protect yourself from the theft of your content: thus, even if some pages copy the content, the robots only take into account and index only your canonical url. Duplicate ones point directly to your page.
What is the difference between canonical url and 301 redirect?
We tend to confuse the two because of their great similarity since they redirect from one page to another. However, you should know that:
- The canonical url is entirely intended for crawler robots: it redirects them to the page to be indexed.
- The 301 redirect redirects crawler robots and Internet users to the page to be taken into account. It does not affect indexing, but rather the user experience.
Being aware of this difference allows you to choose between the redirect and the canonical tag if necessary. When possible, always favor redirection.
Beware of errors when using the canonical url
Some errors were actually recorded because of their frequency. To get your canonical urls correct, here’s what to avoid in the future:
- Use the same canonical url for different content:
The canonical url should only be used when there is duplication of content and therefore in the event of similar content. Always try to verify that you have entered the correct url, otherwise pages with different recorded content will not be indexed.
- Reverse the source page to index and the secondary one:
A good check allows you to avoid this kind of error. If this happens, it is because instead of indexing your page, you will have the opposite effect.
- Insert the tag into the body:
The canonical tag must be in the head. Remember this, because otherwise it would be useless.
- Use several canonical urls for the same page:
It might sound silly, but this type of error has been recorded more times than you might think. It should absolutely be avoided, because yes, the page will be considered as the one to index, but the url that the spiders will choose to keep will not necessarily be the best optimized.
- Mix canonical urls and redirects made:
If you redirected page A to page B, make sure page B (redirect landing page) has the canonical url and not the redirected one. It makes perfect sense, but sometimes you get tangled up in your brushes.
There you have it, now that you know what a canonical url is and what it is for, do not hesitate to use it when it seems necessary to you.