The canonical tag (rel="canonical") sits in the <head> of a page and names the preferred URL for that content. Search engines use it to group duplicate or near-duplicate URLs together and send the ranking signals to one version instead of splitting them.
Duplicates happen more than most site owners realize. Tracking parameters, sort orders, print versions, trailing slashes, http versus https and www versus non-www can all produce several URLs for one page.
Why it matters
Bean & Barrel Coffee sells a Colombian single-origin bag. On their WooCommerce store, the same product shows up at /product/colombia-huila/, /shop/single-origin/colombia-huila/ and /product/colombia-huila/?utm_source=newsletter. Without a canonical, Google has to guess which one to rank, and links pointing to different versions get split. With a canonical on each version pointing to /product/colombia-huila/, the signals are pooled on one URL.
The tag
<link rel="canonical" href="https://www.example.com/product/colombia-huila/" />
Use an absolute URL, including https://. Most pages should carry a self-referencing canonical that points to themselves. WordPress SEO plugins such as Yoast and Rank Math add this by default.
A hint, not a command
Google treats the canonical as a strong signal, not an order. If your canonical points to a page that redirects, returns a 404, or has very different content, Google will often ignore it and choose its own. The URL Inspection tool in Search Console shows both the “user-declared canonical” and the “Google-selected canonical”, so you can see when they disagree.
Common mistakes
- Pointing every page in a paginated series to page 1. Page 2 has different products, so it should canonical to itself (see pagination).
- Canonicalizing to a URL that has a noindex tag. That sends mixed signals.
- Using relative URLs or the
httpversion on an HTTPS site. - Adding two canonical tags, one from the theme and one from a plugin.
- Using a canonical when a 301 redirect is the right fix. If the old URL should never be visited, redirect it.
How to check
Search Console’s Page indexing report lists “Duplicate without user-selected canonical” and “Duplicate, Google chose different canonical than user”. A crawl with Site Audit flags missing canonicals, canonicals that point to redirects or broken pages, and pages with conflicting tags.