Rel=”canonical” tag is used in website source code and it is also the important part of the search engine optimization. It used to remove duplicity of page on the same site. Lets we discussed in details that why and how we use this tag.
I will explain you with the help of an example:-
These are the two different URL’s with the same content. So, we prefer those URL which is search or user friendly and easily readable or indexed by a spider (crawler).
In the above example 1st URL is easily readable and search friendly compare to 2nd one.
Image Courtesy : ericmobley.net
Canonical tag is used to hide the duplicate content which is present on your website. Generally, this tag is used in the right page url to make understand that it is the main url for that page of your website. This tag is very important for better ranking and results for right URL.
In our example shown below the page from item B) will be redirected to the right page by adding the following text in your source which is found in the head part of your webpage:
<link rel="canonical" href=" http://www.website.com/page -id-123/~>
Then whatever page you mentioned in the canonical link will be indexed in the search engine database. And the search engine will give highest priority for this page. Canonical link just gives the hint to search engines that which page is most important for us or our website.
Why we use this tag?
It is not a real Meta tag and by adding this rel=”canonical” tag you inform to search engine which your main page. But keep in mind this doesn’t mean that crawler will not pay attention on other page. That story is fabled.
How to add this tag on any website source?
Rel=”canonical” tag can be added by the following way mentioned below.
<link rel="canonical" href="url" />