GetPicked

AI search glossary

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

A canonical tag is a link element, written as rel="canonical" in a page's head, that tells search engines which URL is the preferred version of a page when the same or very similar content is reachable at several URLs.

Also called: rel=canonical, canonical URL, canonical link element

Why it matters for AI search

AI engines that search the web cite URLs from search indexes, so the URL a search engine chooses as canonical is usually the one that gets cited. If duplicates split your signals, or a stray canonical points to the wrong page, an AI answer may link to a filtered URL, an old version, or nothing of yours at all. Clean canonicals make sure the page you want to be cited is the one engines index.

How a canonical tag works

The same content often lives at several URLs: with and without www, with tracking parameters, under two category paths, or as a print version. Search engines group these duplicates and pick one URL to show and to credit with links. The canonical tag is your vote for which one:

<link rel="canonical" href="https://www.example.com/grinder-g2" />

It goes in the head of every duplicate, and on the main page itself as a self-reference.

Canonical signals, strongest to weakest

Google lists several ways to indicate the preferred URL:

MethodGoogle's descriptionUse it for
301 redirectA strong signal that the redirect target becomes canonicalRetiring an old URL completely
rel="canonical" link elementA strong signalDuplicates that must stay reachable (filters, parameters)
rel="canonical" HTTP headerAlternative to the link element, for web searchPDFs and other non-HTML files
Sitemap inclusionA weak signalReinforcing the URLs you already canonicalize

None of these is required, and Google may pick a different canonical if your signals conflict.

Rules that prevent canonical mistakes

  1. Use absolute URLs, including the protocol and host, not relative paths.
  2. Send one consistent signal. Do not name different canonicals in the HTML, the HTTP header and the sitemap. Choose either the HTML element or the header, not both.
  3. Link internally to the canonical URL, and list only canonical URLs in your XML sitemap.
  4. Do not canonicalize to a URL fragment (a #section link).
  5. Keep JavaScript away from it. Put the canonical in the server HTML. If a script rewrites it, Google may see two different values; see JavaScript SEO.
  6. For translated pages, canonicalize to a page in the same language, not to the English original.
  7. Do not use robots.txt or noindex to resolve duplicates. You can check what your robots.txt blocks with the robots.txt checker.

How to check which canonical Google chose

In Search Console, the URL Inspection tool shows both the canonical you declared and the one Google selected. When they differ, look for conflicting signals: redirects pointing elsewhere, internal links to the duplicate, or a sitemap listing the wrong version. Fixing those is often enough for Google to follow your choice, and it means the URL AI answers cite is the one you maintain.

Questions

Is the canonical tag a directive or a hint?
Google treats it as a strong signal, not a command. It says the rel=canonical link is a strong signal that the specified URL should become canonical, but it may still choose a different URL if other signals disagree.
Should a page have a self-referencing canonical?
Yes. Google recommends that the canonical page include a canonical tag pointing to itself, which protects it when parameters or tracking codes create copies of the URL.
Can I use robots.txt or noindex instead of a canonical?
No. Google says not to use robots.txt for canonicalization, because blocked URLs can still be indexed without their content, and not to use noindex to choose a canonical within a site, because it removes the page from Search.
Can JavaScript set the canonical tag?
It can, but Google recommends putting the canonical in the HTML source. If JavaScript sets it, it should use the same value as the original HTML, and only one canonical tag should exist.

Related terms

Sources