SiteAudit.dev
Tools

Canonical URLs · Practical guide

Canonical tags explained: choosing and checking the preferred URL

A canonical reference identifies the preferred URL among duplicate or very similar pages. The useful question is whether the destination represents the same content, not whether a tag exists. Compare the source, destination and surrounding signals before applying a rule across a site.

Check a tracking URL for conflicting canonical declarations

Suppose /guides/caching?utm_source=newsletter serves the same article as /guides/caching. Its HTML identifies the clean article as canonical, but its HTTP response contains the different Link target shown below. This is a hypothetical configuration example, not a measured result.

SiteAudit extracts the first matching canonical from fetched HTML and resolves its reference. That value alone does not establish that the response headers agree or that only one HTML declaration exists. Inspect the actual response headers and HTML source separately. In this example, review the application and server configuration so the declared preference is the clean, equivalent article rather than the homepage.

Check that the clean destination is reachable and contains the matching article. Internal links and the sitemap should also use that URL. Do not strip a parameter that changes the actual content, and remember that Google can still choose another canonical.

Requested URL: https://example.com/guides/caching?utm_source=newsletter

HTTP response header:
Link: <https://example.com/>; rel="canonical"

HTML head:
<link rel="canonical" href="https://example.com/guides/caching">

Intended preference, after confirming equivalent content:
https://example.com/guides/caching
  1. Audit the clean URL and tracking variant, then inspect their response headers and HTML source for all canonical declarations.
  2. Open the proposed destination, confirm equivalent content, and correct conflicting declarations in the responsible application or server configuration.
  3. Reaudit after deployment and use Search Console to compare the declared and Google-selected canonical when available.

Reference: Google Search Central: Canonical annotation methods

Choose the mechanism for the actual problem

A canonical annotation expresses a preference; it does not redirect the visitor or compel Google to select that URL. Use a permanent redirect when an old URL should move visitors to its replacement. Use a canonical when equivalent URLs remain accessible and need a consistent preferred version.

Indexing controls answer a different question. A canonical cannot cancel noindex, and noindex should not be used merely to force a preferred canonical. Preserve deliberate exclusions for pages that should stay out of search. Neither instruction provides authentication or protects private content.

Non-HTML documents, such as PDFs, can supply the preference through an HTTP Link response header. Inspect that header on the document’s GET response; an HTML-only check cannot establish it. Google recommends choosing one annotation method to reduce conflicting targets. If both header and HTML methods exist, keep their destinations consistent.

Link: <https://example.com/guides/caching>; rel="canonical"

Reference: RFC 6596: the canonical link relation

Keep distinct pages distinct

Check the response body before removing parameters. A campaign label may leave the article unchanged, while version=2, lang=fr or page=2 can select different content. A blanket rule that strips every query string can silently point useful pages at the wrong resource.

Read the main content rather than comparing templates. Two category pages can share navigation and still list different products. Pagination is a common failure: page two normally needs its own canonical, not a declaration that page one represents all its items.

Translated pages should not automatically canonicalize to the default language. Keep appropriate canonicals for the language versions and use reciprocal hreflang annotations to describe their relationship. Similar regional pages in the same language need a separate equivalence review.

Keep distinct pages distinct
URL variationUseful check
utm_source=newsletter Does the main content really match the clean article?
page=2 Does this page have a distinct item set and its own canonical?
/fr/guide Does the French content retain its intended language URL?
version=2 Does removing the parameter switch to different documentation?

Reference: Google Search Central: pagination and canonical URLs

Review the source and the surrounding signals

Use the preferred address in internal links and sitemap entries. Use an absolute canonical in the HTML head, including a self-reference on the preferred page. Check production scheme, hostname, path and meaningful query values. Remove template leftovers pointing at staging, another article or the homepage. Prefer the final intended page over a redirecting canonical target, and investigate any target that returns an error or unrelated content.

SiteAudit reads the first matching canonical link in the head of the captured HTML and resolves its reference. It does not fetch that target, identify all duplicate declarations or interpret HTTP Link canonicals. Query values in its evidence are redacted, so inspect the original source locally when comparing parameter values.

Keep the canonical clear in the HTML source and avoid changing it with JavaScript. Inspect both the original HTML and browser DOM if scripts already change metadata. SiteAudit does not execute that JavaScript. A found canonical is evidence of a field, not a verdict on equivalence, indexing or rankings.

Reference: Google Search Central: troubleshoot canonicalization

Verify the response and Google’s separate interpretation

This macOS/Linux GET saves headers and HTML in a new directory. Replace the example URL, then repeat the entire snippet for its declared destination. Read the final status, headers and body; a 200 can still contain a login page or soft error. Review every canonical declaration in the source, not just the first search match.

canonical_check_dir=$(mktemp -d ./canonical-check.XXXXXX) &&
curl -q -sS -L --max-redirs 5 --max-time 30 --compressed \
  -D "$canonical_check_dir/headers.txt" \
  -o "$canonical_check_dir/page.html" \
  --write-out 'HTTP %{http_code}\nFinal URL: %{url_effective}\nSaved: %{filename_effective}\n' \
  'https://example.com/guides/caching?utm_source=newsletter'
  1. Check the variant and destination, including headers, main content, robots directives and any redirect chain.
  2. Retest a second article, a paginated page and a language variant to catch template-wide mistakes.
  3. Use Search Console URL Inspection’s indexed information to compare the user-declared and Google-selected canonical. The live test does not predict Google’s canonical choice.

Reference: Google Search Console: indexed information and live URL inspection

Keep reading

Related guides

All guides & reference
Quick reference

Indexing signals reference: robots, noindex, canonicals and sitemaps

Compare crawl access, indexing controls, canonical signals and discovery evidence when reviewing a public page.

Open reference