Canonical link element

{{short description|Type of hyperlink}}

A canonical link element is an HTML element that helps webmasters prevent duplicate content issues in search engine optimization by specifying the "canonical" or "preferred" version of a web page. It is described in RFC 6596, which went live in April 2012.{{Cite web|url=https://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html|title=Specify your canonical|last=Kupke|first=Joachim|date=2009-02-12|website=|publisher=Google|archive-url=|archive-date=|accessdate=2012-08-02}}{{Cite web|url=https://www.mattcutts.com/blog/canonical-link-tag/|title=Learn about the Canonical Link Element in 5 minutes|last=Cutts|first=Matt|authorlink=Matt Cutts|date=2009-02-15|website=|archive-url=|archive-date=|accessdate=2012-08-02}}

Purpose

A major problem for search engines is to determine the original source for documents that are available on multiple URLs. Content duplication can happen in many ways, including:{{Cite web |url=https://audisto.com/insights/guides/28/ |title=Link rel=canonical: How to do URL canonicalization right |accessdate=2015-10-06 |publisher=Audisto GmbH | authorlink= Tobias Schwarz & Christian Mueller}}

  • Duplication due to GET-parameters
  • Duplication with multiple URLs due to CMS
  • Duplication due to accessibility on different hosts/protocols
  • Duplication due to print versions of websites

Duplicate content issues occur when the same content is accessible from multiple URLs.{{Cite web|url=https://support.google.com/webmasters/answer/66359|title=Duplicate content|last=|first=|date=|website=|publisher=Google|archive-url=|archive-date=|accessdate=2012-08-02}} For example, {{mono|http://www.example.com/page.html}} would be considered by search engines to be an entirely different page from {{mono|http://www.example.com/page.html?parameter=1}}, even though both URLs may reference the same content.{{cite web|url=http://www.revenuel.com/canonical-issue-solution-tag/|title=Canonical Issue and How to Use Canonical Tag – The Proper Way|last1=Biswas|first1=Kushal|date=|website=|publisher=RevenueI|archive-url=https://web.archive.org/web/20160614052029/http://www.revenuel.com/canonical-issue-solution-tag/|archive-date=14 June 2016|accessdate=18 June 2015}}{{cite web|last1=Zadro|first1=Dario|title=Rel=Canonical - A Beginners Guide to Canonical Tags - Where and When to Use Them|date=19 February 2015 |url=https://zadroweb.com/a-beginners-guide-to-canonical-tag/|publisher=Zadro Web|accessdate=18 June 2015}}

In February 2009, Google, Yahoo and Microsoft announced support for the canonical link element, which can be inserted into the HTML element#head of a web page, to allow webmasters to prevent these issues.{{Cite web|url=https://searchengineland.com/canonical-tag-16537|title=Google, Yahoo & Microsoft Unite On "Canonical Tag" To Reduce Duplicate Content Clutter|last=Fox|first=Vanessa|authorlink=Vanessa Fox|date=2009-02-12|website=|publisher=Search Engine Land|archive-url=|archive-date=|accessdate=2012-08-02}} The canonical link element helps webmasters make clear to the search engines which page should be credited as the original.

How search engines handle <code>rel=canonical</code>

Search engines try to utilize canonical link definitions as an output filter for their search results. If multiple URLs contain the same content in the result set, the canonical link URL definitions will likely be incorporated to determine the original source of the content. "For example, when Google finds identical content instances, it decides to show one of them. Its choice of the resource to display in the search results will depend upon the search query."How Google And Other Search Engines Manage Canonical Links | http://seomediax.com/seo/how-google-and-other-search-engines-manage-canonical-links/

According to Google, the canonical link element is not considered to be a directive, but rather a hint that the ranking algorithm will "honor strongly".{{Cite web|url=https://support.google.com/webmasters/answer/139066#2|title=Consolidate duplicate URLs - Search Console Help|website=support.google.com}}

While the canonical link element has its benefits, Matt Cutts, then the head of Google's webspam team, has said that the search engine prefers the use of 301 redirects. Cutts said the preference for redirects is because Google's spiders can choose to ignore a canonical link element if they deem it more beneficial to do so.{{Cite web|url=https://www.mattcutts.com/blog/rel-canonical-html-head/|title=A rel [equals] canonical corner case|last1=Cutts|first1=Matt|authorlink=Matt Cutts|date=2011-05-16|website=|archive-url=|archive-date=|accessdate=2012-08-02}}

Factors Google considers when choosing a canonical for a page

There are multiple factors Google evaluates when determining the canonical version of a page, including:

  • The canonical tag you set up: This is the most direct way to suggest the preferred URL to search engines.
  • Internal linking: Pages with strong internal links pointing to them are more likely to be treated as canonical.
  • Sitemap.xml: The URLs listed in the sitemap also influence Google's decision.
  • Redirects: Google may choose a URL redirected to from others as the canonical version.

Implementation

= Semantic tag =

The canonical link element can be either used in the semantic HTML {{tag|head|o}} or sent with the HTTP header of a document. For non HTML documents, the HTTP header is an alternate way to set a canonical URL.{{Cite web|url=https://support.google.com/webmasters/answer/139066#6|title=Consolidate duplicate URLs - Search Console Help|website=support.google.com}}

By the HTML 5 standard, the HTML element must be within the {{tag|head|o}} section of the document.{{Cite web|url=https://www.w3schools.com/tags/tag_link.asp|title=HTML link tag|website=www.w3schools.com|access-date=2019-01-07}}

Examples

= HTML =

Below is an example of HTML code that uses the {{mono|1=rel=canonical}} inside the {{tag|head|o}} tag. The code could be used on a page, such as https://example.com/page.php?parameter=1to tell search engines that the https://example.com/page.php is the preferred version of the webpage.

...

= HTTP =

HTTP/1.1 200 OK

Content-Type: application/pdf

Link: ; rel="canonical"

Content-Length: 4223

...

See also

References

{{Reflist}}

{{DEFAULTSORT:Canonical link element}}

Category:Search engine optimization

Category:HTML