Canonical URLs: what the check tests and how to fix it

Counts crawled pages with a non-empty <link rel="canonical"> in the served HTML. 80% passes. It does not check the URL points anywhere sensible.

Technical · Weight 1 in the w2agent Score

How common is it?

69% of 1223 measured sites where this check applied pass.

Latest audit of each site under rubric v3.1. Sites where the check did not apply or could not be measured (for example, no llms.txt for the llms.txt checks) are left out. A partial result does not count as a pass.

What this check tests

For each crawled page (the homepage plus a sample of same-site pages) the audit parses the HTML as served and looks for a <link> element whose rel attribute is exactly canonical. The page counts when that element's href is not empty. The score is the share of crawled pages that count, rounded.

  • Pass: 80 or more.
  • Partial: above 0 but under 80.
  • Fail: 0, meaning no crawled page has a canonical link.

The check goes no further than that. It does not test whether the href is absolute, whether it points to the page itself or to a different page, whether the target returns a 200, whether a page has two conflicting canonical tags, or whether the value agrees with your sitemap. A canonical sent as an HTTP Link response header is not seen, and neither is one that a script adds in the browser. The first is a valid method that this check does not read. So a site that uses only the header method will fail here although it has canonicals.

Why it matters to agents

A canonical URL says which address is the preferred one when the same content can be reached at several. Google's documentation describes rel="canonical" as a strong signal that the named URL should become canonical, ranked below redirects and above sitemap inclusion, and gives reasons to state a preference: choosing which URL people see in results, merging link signals for duplicates, and simplifying tracking. It also says that it is generally not critical to specify one, that your site will likely do fine without, and that when you do not specify one Google picks the version it judges best to show.

That documentation is about Google Search. This page cites no AI vendor document describing how an assistant treats canonical links. The reasoning for other consumers is a simple one: a page reachable at ?utm_source= variants, www and non-www hosts, or trailing-slash variants has no single obvious address. A tool that reads the canonical link gets the one to store and cite. Weight is 1.

How to fix it

Put one self-referencing canonical in the <head> of every indexable page, in the HTML the server returns:

<link rel="canonical" href="https://example.com/pricing" />
  • Use an absolute URL with the scheme and host. Google advises absolute paths over relative ones, because relative ones can cause problems later, for example if a test site is crawled.
  • Point it at the version you want people to land on: the https address, with or without www as you prefer, and the same trailing-slash style your site uses. Stay consistent with the URLs in your sitemap and internal links.
  • For pages that really are duplicates of another page, point the canonical at that other page. For ordinary pages, point at the page's own address.
  • Keep it in the HTML. Google's JavaScript guidance says the best way to set the canonical is in HTML, and that if you use JavaScript it must give the same value as the original HTML. This check only reads the original HTML.
  • If a framework or SEO plugin already writes canonicals, check the page source to see that the output is present on every template, including archive, pagination and tag pages, and that there is only one.
  • If you serve non-HTML files such as PDFs, Google documents a Link: <url>; rel="canonical" response header for them. This check does not read that header and only looks at HTML pages.

Redirects are the stronger tool when an old address should disappear; see Status codes and HTTPS. Match og:url to the same value, see OpenGraph meta tags.

Examples from measured sites

Up to 10 of the highest-scoring sites in each group, from recent audits. Failing includes partial results.

Passing

Failing or partial

Sources

Verified against these sources on

Does your site pass this check?

Check your own site →