What is a Canonical URL
This is the URL that people will see in:
- the sitemap
The same page may have different URL such as:
The link rel canonical defines which one is the good identifier and don't let robot such as google search defines it by chance.
Published in the category
The same page may be published in a category
The same page may be syndicated (published on another site)
A page may be translated.
Mobile vs Desktop
A Mobile page and desktop page may not be served from the same domain and link canonical permits to identify them as the same resource.
Moving a page
Moving a page to another URL without losing integrated components such as embedded discussion components.
A Rel canonical is a tag in the header in a HMTL page that tells search engines:
- which piece of content is the original and which one is a duplicate. It has been created in order to avoid duplicate content
- which operates exclusively on a single root domain (it will carry over across subfolders and subdomains, not cross domain)
A link rel canonical is a link html element with a rel attribute.
<link rel="canonical" href="https://datacadamia.com/cat/post1" />
Make sure that you use:
- an absolute path (https://domain/path)
- rather than a relative path (path)
for the canonical href value.
og:url meta property
<meta property="og:url" content="https://example.com/path" />
Documentation / Reference
- Specification: Rfc6596 - The Canonical Link Relation