Canonical link

from Wikipedia, the free encyclopedia

A canonical link , English canonical link element gives website operators in an HTML -Dokument the opportunity for multi-used content ( duplicate content expel the original resource). It is described in RFC 6596 and is noted in the form of an linkelement of the canonical attribute, English canonical tag , in the header of an HTML document . Example:

<link rel="canonical" href="https://example.com/unterseite.html">

A trailing slash is required in XHTML , not in HTML - from HTML 5 , however, it is recommended to set it anyway so that the document is also valid XML .

purpose

It often happens that multiple URIs refer to the same content. Examples are dynamically generated content, such as in forums or other content management systems , in which the same entries can be called up at different addresses; this can be due, for example, to different filter options or session IDs. Further examples are print views of websites or local copies of files such as licenses. In these cases the canonical link can be used to specify the primary URI under which the content should be accessible. Without this information, there is a risk that search engines will index the content arbitrarily and may consider the duplicate as the primary resource.

Linking websites, especially search engines with their link databases, can find the original document for a page and refer to it in the search results. The attribute was introduced by search engine operators - above all Google  - to make it easier for their web crawlers to reliably identify the primary resource. However, there is no guarantee that it will be observed by search engines. Since the canonical attribute is treated by search engine crawlers in a similar way to a 301 redirect code , the term “link”, which is almost always associated with a clickable link ( aelement) in an HTML document, is somewhat misleading . The term "link" ( Engl. For "link") refers to the fact that two documents are linked with each other without it necessarily a user interaction would be required.

Incorrect use of canonical links (e.g. several in an HTML document, the placement of the element in the body area , reference to an abbreviated URL, inconsistent mix of “noindex” and “ nofollowmeta-attributes , locking out of search engine crawlers via robots. txt ) causes problems and generally prevents the canonical link from working.

Web links