What is a canonical URL (rel=canonical) in SEO?
A canonical URL is the address a site declares as the preferred one when the same content is served from several URLs, with a rel=canonical annotation in a page's HTML or in its HTTP header. A canonical is a hint, not a command: Google combines it with other signals and may choose a different URL as the canonical.
Key takeaways
- A canonical declares a preference. Google treats it as a strong signal, but it can settle on another URL.
- In a store, the same product lives at several URLs (from a collection, with a variant, with a sort parameter): the canonical says which one counts.
- Redirects, canonical and sitemap have to point at the same URL; if they contradict each other, Google decides.
- Do not use robots.txt or noindex to canonicalize: Google expressly advises against it.
- The URL Google chose shows in Search Console's URL Inspection, in the indexed data, not in the live test.
Here "canonical" is not Canonical, the company that publishes Ubuntu, which takes up a good part of the first page when you search the word alone. It is the tag a page uses to say which URL should count when its content can be opened from several addresses. In a store that happens daily: the same product can have three or four URLs, and if you do not say which is the right one, the search engine picks it. That product page's signals get split across addresses, and the one that shows up in the results may not be the one you link in your campaigns.
How it works
The IETF defined the canonical relation in April 2012, in RFC 6596, authored by M. Ohye and J. Kupke. It is used to point to the preferred URL among a set of resources that serve the same content in duplicate. The URL it points to has to be a duplicate of the page or a superset of its content, not a different page. And the text warns of three mistakes that make content get lost: pointing to a URL that redirects, to one that returns an error or to the first page of a paginated series.[1]IETF (Ohye and Kupke). RFC 6596: The Canonical Link Relation
Google calls the process of choosing the representative URL for a piece of content canonicalization. The causes of duplication it lists are the ones in any store: regional variants, mobile and desktop versions, http versus https, site features such as sorting and filtering, and test versions indexed by accident.[2]Google Search Central. What is URL canonicalization Having some duplicate content on a site is normal and does not violate its spam policies.[2]Google Search Central. What is URL canonicalization
To say which one you prefer, Google accepts several methods and gives them different weights:[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods
| Method | How it is declared | Weight for Google |
|---|---|---|
| Redirect | The duplicate URL redirects to the right one | Strong signal |
rel="canonical" in the HTML |
A <link> element in the <head> |
Strong signal |
rel="canonical" in the HTTP header |
A Link header in the response |
Strong signal |
| Sitemap | Include only the right URL in the sitemap | Weak signal |
In addition, Google prefers https to http and takes hreflang groups into account.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods The versions of a page in different languages only count as duplicates if the main content is in the same language.[2]Google Search Central. What is URL canonicalization
What is most worth remembering is the limit: you can state your preference, but Google may choose another page as the canonical for several reasons. In its words, specifying a canonical is a hint, not a rule.[2]Google Search Central. What is URL canonicalization For the hint to carry weight, Google asks for absolute URLs rather than relative ones, for the right URL to declare itself canonical, for the <link> element to go only in the <head>, for the different methods to point at the same URL and, on sites that depend on JavaScript, for the canonical to be in the source HTML instead of being injected afterward.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods
In a store
A fictitious example: a store sells a travel tripod, and the same product can be opened from four addresses.
| URL | Where it comes from | Canonical it should declare |
|---|---|---|
/products/travel-tripod-t20 |
The product's own URL | Itself |
/collections/tripods/products/travel-tripod-t20 |
The link from a collection | /products/travel-tripod-t20 |
/products/travel-tripod-t20?variant=4471 |
A variant selection | /products/travel-tripod-t20 |
/products/travel-tripod-t20?utm_source=newsletter |
A campaign link | /products/travel-tripod-t20 |
In the HTML of all four, the line that matters is the same:
<head>
<link rel="canonical" href="https://store.example/products/travel-tripod-t20" />
</head>
For a file that is not HTML, such as the spec sheet in PDF, the same indication goes in the response header: Link: <https://store.example/products/travel-tripod-t20>; rel="canonical".
If your store is on Shopify, the platform adds canonical URLs to pages automatically to keep duplicate content from showing up in the results.[4]Shopify Help Center. SEO overview In the theme, the line comes from the Liquid global object canonical_url, inside the <head>: <link rel="canonical" href="{{ canonical_url }}" />.[5]Shopify Dev Docs. Add SEO metadata to your theme That covers the normal case. What it does not cover is the inconsistency you add yourself: an external sitemap that lists the collection URLs, a campaign that always links with parameters or an app that writes a second canonical.
What people often get wrong
Blocking the duplicate URL or marking it noindex is not canonicalizing. Google expressly asks that you not use robots.txt, the URL removal tool or noindex to choose the canonical.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods Blocking with robots.txt stops the crawler from reading that page's canonical, and a noindex tells it not to index the page, which is a different instruction. What works is a consistent canonical or, if the duplicate URL does not have to exist for anyone, a redirect.
How to check it
- Open the source code of a product page (Ctrl+U in Chrome, not the inspector) and search for
rel="canonical". There should be exactly one, inside the<head>, with an absolute URL that starts withhttps://.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods - Open the same product page from other addresses: from a collection, with a variant selected and with a campaign parameter. All four have to declare the same canonical.
- Review your XML sitemap: it has to list the canonical URLs and not their variants, because the sitemap is also a signal, though a weak one.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods
- Run the URL through Search Console's URL Inspection and compare the canonical you declared with the one Google selected. That data is only in the indexed data: the live test cannot predict which URL will be the canonical, and the value can lag the index by a few hours.[6]Search Console Help. URL Inspection tool
- If they do not match, look for the signal that contradicts your canonical: a redirect that points to another URL, a sitemap with variants, a second tag or an hreflang that points to another address.
Related concept: 301 redirect
A 301 redirect and a canonical look for the same thing, for a single URL to count, and Google treats both as strong signals.[3]Google Search Central. How to specify a canonical URL with rel="canonical" and other methods The difference is in what the person sees. With the redirect, whoever opens the old URL ends up on the new one and the old one stops existing in practice. With the canonical, both URLs stay open and only which one counts for the search engine changes. That is why in a store they split the work: the redirect for what should no longer exist (a product that changed URL, a merged category) and the canonical for what has to stay open (a variant, a product page seen from a collection, a campaign link). A canonical that points to a URL that redirects mixes the two and, according to RFC 6596, is one of the mistakes that make content get lost.[1]IETF (Ohye and Kupke). RFC 6596: The Canonical Link Relation
The canonical decides which URL gets into the index, so the next step is to understand indexing; this topic's reading path puts the rest of the terms in order.
Synonyms
- English
- canonical tag, rel=canonical
- Español
- URL canónica, etiqueta canónica
Sources
- [1] IETF (Ohye and Kupke). RFC 6596: The Canonical Link Relation. Accessed . ↑ ↑
- [2] Google Search Central. What is URL canonicalization. Accessed . ↑ ↑ ↑ ↑
- [3] Google Search Central. How to specify a canonical URL with rel="canonical" and other methods. Accessed . ↑ ↑ ↑ ↑ ↑ ↑ ↑
- [4] Shopify Help Center. SEO overview. Accessed . ↑
- [5] Shopify Dev Docs. Add SEO metadata to your theme. Accessed . ↑
- [6] Search Console Help. URL Inspection tool. Accessed . ↑
Change history
- First English version.
This definition is published under CC BY 4.0. Reuse this definition freely, crediting Clione with a link to this page.
Related terms
Duplicate content
What duplicate content is, why Google does not penalize it but does split your signals, how AI engines treat it and how to sort it out in an online store.
301 redirect
What a 301 redirect is, how it differs from a 302 or a 308, what Google does with it and how to redirect a product page that changes URL on Shopify.
noindex
What the noindex rule is, how to set it with the robots meta tag or the X-Robots-Tag header, why it fails when robots.txt blocks the page and how to check it.
Indexing
What indexing is, how it differs from crawling, why Google does not store all your product pages and how to read its status in Search Console.
Web crawler
What a web crawler is, how it discovers your store's product pages, what it respects in robots.txt, and how to check in your logs who is visiting.
Faceted navigation
What faceted navigation is, how many URLs a category's filters create, what Google recommends for crawling them and how to check it on Shopify.
Make your catalog easy for bots to read
Clione fills every product page with what bots read best: the JSON-LD graph with its structured data, the meta description and the FAQs. You review and press Push; then we check your live store so it all stays published.