The rel="canonical" tag tells search engines which version of a URL is the authoritative copy when multiple URLs serve identical or near-identical content. Correct canonical implementation prevents index bloat, consolidates link equity, and ensures the right page ranks for each query.
Why Canonicals Exist
Most websites generate duplicate content unintentionally. URL parameters (?sort=price), session IDs, tracking parameters (?utm_source=...), HTTP vs HTTPS, www vs non-www, and trailing slashes all create separate URLs for the same content. Without canonicals, Google must guess which version to index.
Canonical Tag Syntax
Place the canonical tag in the <head> section of every page:
<link rel="canonical" href="https://example.com/products/widget" />
The href value must be an absolute URL including protocol and domain. Relative URLs are technically supported but cause implementation errors at scale.
Self-Referencing Canonicals
Every page should include a canonical tag pointing to itself. This is defensive SEO. Even pages without obvious duplicates benefit because it prevents issues from URL parameters appended by advertising platforms, analytics tools, or affiliate systems.
<!-- On https://example.com/blog/seo-guide -->
<link rel="canonical" href="https://example.com/blog/seo-guide" />
Common Implementation Patterns
Paginated Content
Each paginated page should canonicalize to itself, not to page 1. Pages 2, 3, and beyond contain unique content that deserves indexing. Canonicalizing all pages to page 1 removes those pages from the index entirely.
URL Parameters
Product listing pages with sort, filter, or tracking parameters should canonicalize to the clean base URL:
<!-- On /products?sort=price&color=red -->
<link rel="canonical" href="https://example.com/products" />
Cross-Domain Canonicals
When the same content legitimately appears on two domains (syndication, regional variants), the republishing domain can point canonicals to the original. Google treats this as a signal, not a directive, and may ignore it if the domains appear unrelated.
HTTP vs HTTPS and www vs non-www
Server-level redirects handle these best. Use 301 redirects to enforce a single protocol and subdomain, then add matching self-referencing canonicals as a safety net.
Audit Checklist
- Crawl every page and extract the canonical tag value. Tools like Screaming Frog export this in the "Canonicals" tab.
- Check for missing canonicals. Any indexable page without a canonical tag is a gap.
- Verify canonical URLs return 200. A canonical pointing to a 404, 301, or 500 is a wasted signal.
- Compare canonical to actual URL. Flag pages where the canonical does not match the URL being served, unless the mismatch is intentional.
- Check for conflicting signals. A page with
noindexand a canonical to a different URL sends mixed messages. Choose one approach.
Canonicals vs 301 Redirects
Use a 301 redirect when users and crawlers should never see the duplicate URL. Use a canonical tag when users need access to both URLs (e.g., print-friendly versions, filtered product views) but you want only one version indexed.
Common Mistakes
- Canonicalizing to the homepage. This removes the page from the index entirely. Only canonicalize to pages with substantially the same content.
- Placing canonicals in the
<body>. Browsers and crawlers ignore canonical tags outside of<head>. - Conflicting canonical and hreflang. Each hreflang URL must have a self-referencing canonical or canonicalize within its own language cluster.
- Multiple canonical tags. If a page has two canonical tags, Google ignores both. Ensure your CMS, plugins, and CDN are not each injecting their own.