Back to “Technical SEO basics”
Technical SEO basics4 min read

The canonical tag

How to indicate the reference version of a page duplicated by URL parameters, and avoid mistakes that deindex entire pages.

The canonical tag tells search engines which URL should be treated as the reference version when several addresses display identical or near-identical content. Set up wrong, it can make entire pages disappear from results.

The duplicate content problem

The same content accessible through several URLs (with or without a trailing slash, with sorting parameters, in a "print" version, via HTTP and HTTPS simultaneously) creates ambiguity: the engine has to guess which of these URLs to index and display. Without a clear signal, it decides on its own — sometimes differently from one engine to another — which dilutes the page's authority across several addresses instead of concentrating it on one.

This dilution has a concrete cost: external links pointing to different variants of the same page (some to the version with a trailing slash, others without) split their value across several URLs instead of concentrating it on a single reference address. A properly set canonical consolidates that signal onto one URL, strengthening its standing compared to a situation where authority remains scattered.

The common case of URL parameters

Filters, sorting, and campaign identifiers often generate dozens of variants of the same page:

https://example.com/shoes?color=red&sort=price
https://example.com/shoes?sort=price&color=red
https://example.com/shoes?utm_source=newsletter

These three URLs display the same underlying content. Each should point, via its canonical tag, to the "clean" version of the page:

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

Syntax and best practices

The tag goes in the document's <head>, with an absolute URL (never relative) pointing to the version you want indexed. A relative URL (/product/product-name instead of https://example.com/product/product-name) can be misinterpreted depending on how the browser or bot resolves the context, and is an easily avoidable source of error:

<head>
  <link rel="canonical" href="https://example.com/product/product-name">
</head>

A few rules to follow:

  • a page pointing canonically to itself is the correct default situation (it's not an error — it's actually recommended);
  • the canonical URL must be reachable (no redirect, no 404) and consistent with the protocol and subdomain actually in use (https vs http, www vs no www);
  • indicate only one canonical URL per page — a canonical tag is not a list.

When to set a canonical (and when not to)

Set a canonical when several URLs display identical or near-identical content (technical pagination, sorting, tracking). Don't use it as a substitute for a redirect: if an old page is no longer meant to exist, a 301 redirect is the right tool, not a canonical that leaves both URLs active.

A common misconception is treating the canonical as a strict order given to the engine. In reality, it's a strong suggestion: if other signals clearly contradict your choice (massive external links pointing to the "non-canonical" version, for instance), some engines may still choose to index a different URL than the one indicated. This stays rare when the markup is consistent with the rest of the site, but it explains why a canonical poorly justified by the page's actual context is more likely to be ignored.

Common mistakes

  • A canonical pointing to a different page by configuration error (often after a migration or CMS change), which can accidentally deindex a page.
  • Canonicals contradicting each other (page A points to B, which points to C) — known as a canonical chain, and best avoided just like a redirect chain.
  • Forgetting the canonical on multilingual versions, which should be combined with the hreflang tag rather than pointing them at each other as duplicates.
  • Setting a canonical to a page blocked by robots.txt, which prevents the engine from verifying content consistency.

The case of pagination and near-duplicate content

Pagination (page 1, page 2, page 3 of a list of articles) deserves particular attention: each results page displays different content, even if the overall structure looks similar. Setting a single canonical to page 1 for all subsequent pages amounts to asking the engine to ignore the specific content of pages 2, 3, and so on — rarely desirable if that content has its own value. Best practice, in the vast majority of cases, is to leave each pagination page canonical to itself, and rely on clear internal linking rather than the canonical to signal the relationship between pages.

The case of "almost" duplicate content (two very similar product pages differing only by color or size variant) also calls for judgment: if the difference matters to the user (and therefore to the query they type), each variant generally deserves its own indexing rather than being canonicalized to a single version.

For a full overview of every technical point to check before publishing, see the complete technical checklist.