1. Home
  2. Guides
  3. Canonical URLs
SEO guide

Canonical URLs: what rel=canonical does and how to use it

The same page can be reachable at many addresses: with and without www, with tracking parameters, with a trailing slash. A canonical URL tells search engines which one you want treated as the main version.

Key points

  • A canonical is a hint, not a command. Search engines weigh it with other signals such as redirects and sitemaps.
  • Use an absolute URL in a <link rel="canonical"> inside the <head>, one per page.
  • Pages should normally point to themselves. Never canonicalise to a page that redirects, errors or is set to noindex.

What a canonical URL is

Many sites serve identical or near-identical content at several URLs:

  • https://example.com/shoes and https://www.example.com/shoes
  • https://example.com/shoes and https://example.com/shoes/
  • https://example.com/shoes and https://example.com/shoes?utm_source=newsletter

Search engines treat these as separate addresses and have to decide which to show. The canonical URL is the one you prefer. You declare it with a link element in the page head:

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

The process of picking the version to index is called canonicalisation. Without your input, a search engine picks on its own, and it may not pick the one you expected.

It is a hint, not a directive

Google uses the canonical tag as a strong signal but combines it with others: redirects, internal links, whether the URL is in your sitemap, HTTPS, and content similarity. If they disagree, Google may choose another URL. The way to get your preferred version chosen is to make all signals agree.

How to implement it

  1. Use absolute URLs, including the scheme and host. Relative URLs are allowed but easier to get wrong.
  2. Put the tag in the <head>. It is ignored in the body. Only one canonical per page.
  3. Self-reference. A page that is its own preferred version should canonical to itself. It guards against parameter-based duplicates.
  4. Be consistent. Use the same URL format in the canonical, internal links, the sitemap and redirects (HTTPS, with or without www, trailing slash or not).
  5. For non-HTML files such as PDFs you can send a Link: <https://example.com/guide.pdf>; rel="canonical" HTTP header.

Canonical tag or 301 redirect?

If the duplicate URL should not exist at all (for example the HTTP version or the non-www host), use a permanent 301 redirect. A redirect sends visitors and crawlers to the right place. Use rel=canonical when both URLs must stay reachable, such as a product available under several filtered or sorted listings, or syndicated content that you want credited to the original.

Mistakes that cause problems

  • Canonical pointing to a different page by accident (for example every page canonicalised to the home page). Search engines may drop those pages.
  • Canonical to a noindex, redirecting or 404 URL. The signals contradict each other.
  • Canonical pointing to HTTP on an HTTPS site.
  • Multiple canonical tags with different values. They are usually ignored.
  • Canonical set by JavaScript only. It can work, but it is less reliable than having it in the HTML response.
  • Blocking duplicate pages in robots.txt. Crawlers then cannot see the canonical tag.

What the audit checks

The audit reads the HTML your server returns and reports:

  • whether a canonical link exists (missing is a medium finding);
  • whether there is more than one, or one that points to HTTP;
  • whether it points to a different URL than the one that was audited, which is correct for duplicates but worth confirming on a page you want to rank.

Canonicals set after the page loads through JavaScript are not visible to this check. The audit looks at the HTML that the server sends.

See also: Redirects: 301 vs 302, hreflang explained, Find and fix broken links.

FAQ

Should every page have a canonical tag?

It is a good habit. A self-referencing canonical on every indexable page protects against duplicates created by tracking parameters or alternate URLs.

Can a canonical point to another domain?

Yes. Cross-domain canonicals are supported and are used for syndicated content. Use them only when you really want the other site's page to be the one shown.

Does the canonical tag pass link value?

Search engines generally consolidate signals from duplicates onto the canonical URL, but they do not promise how. Use redirects when the other URL should disappear.

What about pagination?

Each page of a paginated series is usually its own canonical, since the content differs. Pointing every page to page one tends to hide the content of later pages.

WebsiteHealthLabs Editorial
Guides explain audit results in plain English. Facts are checked against public documentation from Google, W3C and the browser vendors, and we update them when guidance changes.

↑ ↓ to moveEnter to openEsc to closeAll results