HTML - Canonical URL

What is a Canonical URL

A canonical url is a URL that has a canonical value for a web page meaning that the value should be unique on the internet scope.

This is the URL that people will see in:

The Facebook graph uses this value as identifier for a web page

Why you can get different URL for the same resource

Friendly URL

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)


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="" />

Once created the value should never change even if the page get a new URL

Make sure that you use:

for the canonical href value.

The pages do not need to be absolutely identical. They just need to serve the same content.

og:url meta property

The og:url open graph property served the same goal. Facebook uses it

<meta property="og:url" content="" />

Documentation / Reference

Powered by ComboStrap