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|
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
= Self-hyperlink =
Some sites such as Stack Overflow{{cite web |title=Why does the question title link to itself on the answer page? |url=https://meta.stackexchange.com/questions/47653/why-does-the-question-title-link-to-itself-on-the-answer-page/325170 |website=Meta Stack Exchange |date=2010-04-23}} have on-page hyperlinks which link to a clean URL of themselves. Usability benefits are facilitating copying the hyperlink target URL or title if the browser or a browser extension offers a "Copy link text" context menu option for hyperlinks, the ability for the original URL to be retrieved from a saved page if not stored by the browser into a comment inside the file, as well as the ability to duplicate the opened page into a new tab right next to the currently opened one if the browser lacks such a feature.{{cite web |title=3 FireFox Addons to Easier Copy Links and Anchor Texts |url=https://www.searchenginejournal.com/3-firefox-addons-to-easier-copy-links-and-anchor-texts/26742/ |website=Search Engine Journal |language=en |date=7 January 2011}}
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
...
= HTTP =
HTTP/1.1 200 OK
Content-Type: application/pdf
Link:
Content-Length: 4223
...