Canonical tag — canonical link in SEO
What is a canonical tag?
Canonical tag (<link rel="canonical">) is an HTML element in the <head> section of a page that points Google to the preferred URL version when there are duplicates or very similar content. It's a technical SEO tool preventing ranking signal dispersion across multiple variants of the same page.
Full technical name: canonical URL (canonical URL — detailed definition with code examples). Synonyms used interchangeably: canonical, canonical link, rel canonical, canonical address.
Tag structure
<head>
<link rel="canonical" href="https://example.com/product/oak-cabinet" />
</head>
Components:
rel="canonical"— relationship indicating preferred versionhref— absolute URL of preferred version (always HTTPS, always full path)
When to use canonical tag?
1. URL parameters
Page available under multiple addresses with different query parameters:
/products?color=red(canonical →/products)/products?utm_source=newsletter(canonical →/products)/products?page=2(canonical → itself, not root)
2. HTTPS/HTTP, with www / without www versions
Despite 301 redirects, canonical works as an additional signal:
http://example.com(301 →https://example.com)https://www.example.com(canonical →https://example.com)
3. Syndicated content
Article published on 3 portals — canonical points to the original:
arduralab.com/en/blog/seo-2026(canonical → itself)medium.com/@arduralab/seo-2026(canonical →arduralab.com/en/blog/seo-2026)linkedin.com/pulse/seo-2026(canonical →arduralab.com/en/blog/seo-2026)
4. Products with variants
E-commerce with color/size variants:
/oak-cabinet-90cm(canonical → itself)/oak-cabinet-120cm(canonical → itself, but all link to/oak-cabinetif it's the hub product)
5. Pagination
The old rel="prev/next" practice was retired in 2019. Currently each pagination page's canonical points to itself, NOT root pages.
6. Language versions
Do NOT use canonical between language versions — that's the purpose of hreflang. Canonical only indicates a variant within the same language version.
Common mistakes
❌ Canonical to non-existent page
- Canonical → 404 → Google ignores the signal
- Fix: always verify the target exists and returns 200
❌ Canonical to a page with noindex
- Contradiction — you say "index X" but X has "don't index"
- Fix: remove one of the two
❌ Canonical-chain
/a→/b→/c(canonical chain long 3+)- Google may stop following after 2 hops
- Fix: canonical always points directly to target URL
❌ Self-referential canonical skipped
- Every page should have a canonical pointing to itself
- No self-canonical = Google doesn't know it's the original
- Fix: add automatically via template
❌ Relative URL instead of absolute
<link rel="canonical" href="/product">(relative)<link rel="canonical" href="https://example.com/product">(absolute — correct)- Although Google handles relative, absolute is more reliable
❌ Canonical to a page not included in sitemap
- Sitemap should contain only canonical URLs
- Inconsistency → mixed signals for crawler
Canonical and other directives
noindex— stronger directive; canonical honors it but not vice versarobots.txt Disallow— Google won't index, but the canonical signal is ignored- 301 redirect — stronger than canonical; if it's a permanent move, use 301
x-robots-tag— works per HTTP header; canonical is HTML tag, so PDFs/documents require x-robots-tag canonical (Link: <url>; rel="canonical")
Implementation in popular CMS
WordPress
- Yoast SEO / Rank Math auto-generate canonical based on permalink
- Override per-page in each plugin's UI
Next.js
import Head from 'next/head';
<Head>
<link rel="canonical" href={`https://example.com${asPath}`} />
</Head>
Astro
---
const canonical = new URL(Astro.url.pathname, Astro.site);
---
<head>
<link rel="canonical" href={canonical.href} />
</head>
Shopify
- Auto-generated for products and collections
- Liquid:
{{ canonical_url }}intheme.liquid
Verifying canonical in SEO audit
- ScreamingFrog Spider — "Canonicals" report with errors
- Google Search Console → Indexing → Pages → "Canonical inspected URL"
- Ahrefs Site Audit — canonical errors per page
- Manual check —
view-source:+ Cmd-Fcanonical - MarketingOS —
cli schema checkvalidates canonical in batch
Related terms
- Canonical URL — full definition with code examples (synonym)
- Hreflang — indicating language versions (NOT canonical)
- 301 redirect — stronger directive permanent move
- Robots.txt — differences in operation
- Sitemap XML — contains canonical URLs
- Technical SEO — broader context