Canonical link element
A canonical link element is an
Purpose
A major problem for
- 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
In February 2009,
canonical
link element, which can be inserted into the <head>
section of a web page, to allow webmasters to prevent these issues.[7]How search engines handle rel=canonical
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."[8] [citation needed]
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."[1][9]
While the canonical link element has its benefits,
Implementation
Semantic tag
The canonical link element can be either used in the
By the HTML 5 standard, the <link rel="canonical" href="http://example.com/">
HTML element must be within the <head>
section of the document.[12]
Self-hyperlink
Some sites such as Stack Overflow[13] 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.[14][13]
Examples
HTML
Below is an example of HTML code that uses the rel=canonical inside the <head>
tag. The code could be used on a page, such as https://example.com/page.php?parameter=1
to tell search engines that the https://example.com/page.php
is the preferred version of the webpage.
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://www.example.com/page.php">
</head>
<body>
...
</body>
</html>
HTTP
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://www.newthink.life/page.php>; rel="canonical"
Content-Length: 4223
...
See also
- URL normalization
References
- ^ a b Kupke, Joachim (2009-02-12). "Specify your canonical". Google. Retrieved 2012-08-02.
- ^ Cutts, Matt (2009-02-15). "Learn about the Canonical Link Element in 5 minutes". Retrieved 2012-08-02.
- ^ a b "Link rel=canonical: How to do URL canonicalization right". Audisto GmbH. Retrieved 2015-10-06.
- ^ "Duplicate content". Google. Retrieved 2012-08-02.
- ^ Biswas, Kushal. "Canonical Issue and How to Use Canonical Tag – The Proper Way". RevenueI. Archived from the original on 14 June 2016. Retrieved 18 June 2015.
- ^ Zadro, Dario (19 February 2015). "Rel=Canonical - A Beginners Guide to Canonical Tags - Where and When to Use Them". Zadro Web. Retrieved 18 June 2015.
- Search Engine Land. Retrieved 2012-08-02.
- ^ How Google And Other Search Engines Manage Canonical Links | http://seomediax.com/seo/how-google-and-other-search-engines-manage-canonical-links/
- ^ "Consolidate duplicate URLs - Search Console Help". support.google.com.
- ^ Cutts, Matt (2011-05-16). "A rel [equals] canonical corner case". Retrieved 2012-08-02.
- ^ "Consolidate duplicate URLs - Search Console Help". support.google.com.
- ^ "HTML link tag". www.w3schools.com. Retrieved 2019-01-07.
- ^ a b "Why does the question title link to itself on the answer page?". Meta Stack Exchange. 2010-04-23.
- ^ "3 FireFox Addons to Easier Copy Links and Anchor Texts". Search Engine Journal. 7 January 2011.