Duplicates are everywhere on real sites: http and https, with and without www, trailing slashes, tracking parameters, sort orders, print versions. The canonical tells search engines which one is the main version.
Example
<link rel="canonical" href="https://example.com/guides/llms-txt/" />
For non-HTML files such as PDFs, send the same signal in an HTTP header: Link: <https://example.com/file.pdf>; rel="canonical".
A hint, not a command
Google treats rel=canonical as a strong signal, not a directive. It also looks at redirects, internal links, sitemap URLs and HTTPS. If your signals disagree, Google may pick a different canonical, which Search Console reports as “Duplicate, Google chose different canonical than user”.
Why it matters
Canonicals consolidate ranking signals on one URL and keep crawlers from wasting time on copies. For AI search they also decide which URL gets cited.
Common mistakes
- Every page canonicalized to the homepage, often from a hardcoded template value.
- Canonical points to a URL that redirects or returns 404.
- Relative canonical URLs that resolve wrong on staging or preview domains.
- Canonical set by client-side JavaScript after load, so crawlers that do not render never see it, and Google may see a conflicting value.
- Mixing canonicals and
hreflangso that a localized page canonicalizes to another language.
How Renderly handles it
We check that canonicals, internal links, redirects and the sitemap all agree, template by template. See our technical SEO service.