Web page optimization
The rel='canonical' attribute is an HTML element that enables webmasters to prevent duplicate content issues by specifying the "canonical", or "preferred", version of a web page.
For example, the same web page could be available in a web version and a print version. By using the rel='canonical' attribute in the print version, you show search engines that the web version is the version that should be found in the search results.
The canonical attribute should only be used as a last resort. You should try to avoid duplicate content in the first place. Before adding the attribute, try the following to avoid duplicate content problems:
That said, there are several pages on which you should use the rel='canonical' attribute:
It is very important that you use the canonical attribute correctly. If you enter the wrong URLs, this can have a negative impact on your search engine rankings.
Here are the most common rel='canonical' mistakes:
If you don't use the canonical attribute correctly, your website might be removed from Google. If you're not sure what you're doing, better do not use the canonical attribute at all.
Google sees the rel='canonical' tag as a 'strong suggestion' that they might ignore. If the pages with the canonical URL are totally different, Google will index them anyway.