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.

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:

Duplication due to GET-parameters Duplication with multiple URLs due to CMS (i.e. www or non www urls) Duplication due to accessibility on different hosts/protocols. (i.e. https or http) Duplication due to print versions of websites

Duplicate content issues occur when the same content is accessible from multiple URLs. For example, would be considered by search engines to be an entirely different page from , even though both URLs may reference the same content.

In February 2009, Google, Yahoo and Microsoft announced support for the canonical link element, which can be inserted into the section of a web page, to allow webmasters to prevent these issues. The canonical link element helps webmasters make clear to the search engines which page should be credited as the original.

The canonical link element allows search engines to consolidate indexing and ranking signals from duplicate or similar pages into a single preferred URL.

How search engines handle rel=canonical

Search engines use canonical link definitions to help identify the preferred version of duplicate or substantially similar pages. Canonical link elements are used to consolidate indexing and ranking signals to a preferred URL while reducing duplicate search results and improving crawling efficiency.

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".

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.

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 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.

By the HTML 5 standard, the <link rel="canonical" href="http://example.com/"> HTML element must be within the section of the document.

Self-hyperlink Some sites such as Stack Overflow have on-page hyperlinks which link to a clean URL of themselves. Doing so benefits usability: such hyperlinks facilitate copying the hyperlink URL or title (if the browser or a browser extension offers a "Copy link text" context menu option for hyperlinks), they enable retrieving the original URL from a saved page (in case the browser didn't store the URL in the file, as a comment), and they enable duplicating the opened page into a new tab next to the current one (in case the browser otherwise lacks such a feature).

When the same or very similar content is accessible from multiple URLs, search engines like Google can get confused. For example, the following URLs might all show the exact same page: https://example.com/product https://example.com/product?ref=email https://www.example.com/product https://example.com/product/ Without a canonical tag, search engines don't know which version to index and rank. This can dilute SEO strength and cause a negative impact on search rankings.

Examples

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