Almost every website has duplicate or near-duplicate content. example.com/product and example.com/product?utm_source=email serve the same page. example.com/blog/article might also exist as example.com/blog/article?ref=newsletter. The mobile-specific m.example.com mirrors the desktop site. AMP versions duplicate canonical pages. Search engines have to figure out which URL to index, and they do — but they make better choices when you tell them explicitly.
The canonical tag (<link rel="canonical">) is the explicit instruction. This guide covers what it does, when you need it, the syntax, the mistakes that quietly de-index legitimate pages, and how to verify your canonicals are working.
What a Canonical Tag Looks Like
A single line in the <head> of every page:
<link rel="canonical" href="https://example.com/canonical-url/">
This tells search engines: "the URL of this page (or any near-duplicate of it) is https://example.com/canonical-url/. Index that URL; consolidate any inbound link signals to that URL."
The href should be:
- Absolute — full URL with protocol and domain. Relative URLs work but are riskier.
- The exact URL you want indexed — including or excluding trailing slash, www or non-www, http or https, exactly as you want it.
- Reachable — the canonical URL itself should return 200 OK. A canonical pointing to a redirect or 404 is broken.
The Two Patterns That Cover 95% of Use Cases
1. Self-canonical (most pages)
Every page should have a canonical tag pointing to itself:
<link rel="canonical" href="https://example.com/about/">
This is on the /about/ page itself. It tells search engines "this URL is the canonical version" — useful even when no duplicate exists, because it explicitly disambiguates against URL parameter variations (/about/?utm_campaign=spring) that you don't want indexed separately.
2. Cross-canonical (duplicates)
When you have two URLs serving the same content, both should canonical to the preferred one:
// On https://example.com/products/widget?colour=blue
<link rel="canonical" href="https://example.com/products/widget/">
// On https://example.com/products/widget/
<link rel="canonical" href="https://example.com/products/widget/"> // self-canonical
The colour-variant URL is a duplicate of the canonical product page. Both pages contain the canonical, both pointing to the canonical URL. Search engines consolidate ranking signal at the canonical URL.
When You Actually Need Canonical Tags
Almost always, but particularly:
- URL parameters that don't change content. Tracking parameters (utm_*, fbclid, gclid), session IDs, sort/filter parameters that produce the same content. Every URL with these should canonical to the parameter-free version.
- HTTP and HTTPS variants. Even if you redirect HTTP to HTTPS, search engines may still encounter both. The HTTPS version's canonical points to itself; HTTPS is what gets indexed.
- www and non-www variants. Same reason. Your redirect should handle this, but the canonical reinforces it.
- Trailing slash variants.
/pageand/page/are different URLs; a self-referencing canonical disambiguates. - Pagination archives. Page 2 of a blog archive should canonical to itself (NOT to page 1) — it's a distinct page with distinct content.
- E-commerce product variants. Same product with different colour/size in URL parameters: canonical to the base product URL.
- Print-friendly versions.
/article?print=1canonicals to/article. - Mobile-specific URLs. If you serve a separate
m.example.com, the mobile URL canonicals to the desktop URL (and vice-versa via<link rel="alternate">). - Syndicated content. If your article appears on a partner site, the syndicated copy should canonical to your original.
Common Mistakes
1. Canonical pointing to a 404
The canonical URL doesn't actually exist. Search engines either ignore the canonical (and may index the non-canonical version) or worse, treat the page itself as low-quality. Always verify your canonicals resolve to 200.
2. Canonical pointing to a redirect
Canonical → 301 → final URL. Search engines may follow the chain or may treat the canonical as ambiguous. Always canonical directly to the final destination.
3. Same canonical on every page
The site-wide template hard-codes a canonical pointing to the homepage. Result: every page on the site canonicals to the homepage, telling search engines "everything here is just the homepage." Catastrophic. The canonical should be page-specific (typically self-canonical).
4. Canonical with URL parameters
Canonical tag includes the very tracking parameters it should be removing: <link rel="canonical" href="https://example.com/page/?utm_source=email">. Search engines see this as the canonical version including the tracking — defeating the purpose. Always strip parameters from canonicals.
5. Canonical to a different domain
Sometimes intentional (syndicated content), often accidental (canonical points to a staging or development URL that escaped into production). Verify carefully.
6. Inconsistent canonicals across page variants
The blue-widget page canonicals to the base widget; the red-widget page canonicals to itself. Search engines see the inconsistency and may not consolidate as expected. Pick one canonical strategy per template.
7. Multiple canonical tags on one page
Two <link rel="canonical"> tags in the head. Search engines treat as ambiguous and may pick either or neither. Common when a CMS template adds one and an SEO plugin adds another. Audit and remove duplicates.
8. Canonical in the body instead of head
Some platforms render canonical tags in the body. Browsers may or may not honour these; search engines explicitly state the canonical must be in the head. Move it.
Canonical and noindex
Canonical and noindex are sometimes confused but do different things:
- Canonical says: "consolidate this URL with the canonical URL". Both URLs may still appear in search; the canonical gets ranking credit.
- Noindex says: "don't index this URL at all". The page disappears from search.
Use canonical for duplicates where the content is essentially the same. Use noindex for pages that genuinely shouldn't be in search (admin pages, thank-you pages, internal search results).
Don't mix them. noindex + canonical is contradictory — one says "drop me" while the other says "consolidate me with this other page". Search engines treat noindex as authoritative and ignore the canonical. Pick one.
Canonical Header vs Canonical Tag
Canonicals can also be set via HTTP header:
Link: <https://example.com/canonical-url/>; rel="canonical"
This is functionally equivalent to the HTML tag but works for non-HTML resources (PDFs, images). For HTML pages, use the HTML tag — it's easier to set, easier to debug, and easier for tools to extract.
Do not set both header and tag with conflicting URLs. Pick one mechanism per page.
Verifying Canonicals
- Run any URL through Meta Tag Checker — it shows the canonical tag along with all other meta tags.
- View Source in your browser and search for "canonical" — visual confirmation.
- curl the URL and grep for canonical:
curl -s https://example.com/page/ | grep canonical. - Google Search Console → URL Inspection — Google reports the URL it has chosen as canonical for any given URL, and whether it matches the one you declared.
The Search Console check is the authoritative one. Google may sometimes choose a different canonical than the one you declare (especially when multiple pages have very similar content); when this happens, it's reported in the URL Inspection tool and you can investigate.
The Production Habit
For new pages:
- Always include a self-canonical in the head template.
- Use absolute URLs.
- Include the trailing slash if your site uses them; exclude if not.
- Strip URL parameters — the canonical should be the parameter-free version.
- Verify the canonical resolves to 200 (not redirect, not 404).
For existing sites:
- Audit with a crawler (Screaming Frog, Sitebulb) to find pages without canonicals or with broken canonicals.
- Spot-check templates: does every template type have the right canonical strategy?
- Check Search Console for "canonical" issues in the Pages report.
- Re-audit after any template or URL structure change.
Canonicals are one of those quiet maintenance items — they almost never cause obvious problems, but their absence quietly fragments your ranking signal across URL variants. Meta Tag Checker takes the guesswork out for any URL you want to verify.