Technical SEO · 2026-08-21
Canonical Tags: The Complete Guide With Examples
Canonical tags tell search engines which URL is the master version of duplicate or near-duplicate pages. Here's how to use them right, with examples.

TL;DR
A canonical tag is a snippet of HTML—`<link rel="canonical" href="https://example.com/page" />`—that tells search engines which URL is the master version of a page when several URLs show the same or similar content. It consolidates ranking signals onto one URL, prevents duplicate-content dilution, and controls which version appears in search results.
You place it inside the `<head>` of a page. Example: on `https://shop.com/shirts?color=blue`, you'd add `<link rel="canonical" href="https://shop.com/shirts" />` so Google treats the clean `/shirts` URL as the one to index and rank, not every color-filtered variant. The tag is a hint, not a directive—Google usually respects it but can override it if signals conflict.
The most common use case is duplicate URLs created by parameters. Shopify, WooCommerce, and most CMS platforms generate variants like `?ref=`, `?sort=price`, session IDs, and print versions. Each is a separate URL to a crawler. Without a canonical, your crawl budget gets spread across dozens of near-identical pages and ranking signals fragment. A self-referencing canonical on the clean URL fixes this.
Four rules keep you out of trouble. First, always use absolute URLs (`https://example.com/page`), never relative paths. Second, point to the HTTPS, non-www (or www—pick one) version that matches your live domain, no trailing-slash mismatches. Third, use one canonical per page; multiple tags cause Google to ignore all of them. Fourth, don't canonicalize paginated pages (`/blog?page=2`) to page one—each should self-reference.
Set a self-referencing canonical on every important page, even ones with no duplicates. It's a defensive habit: a page pointing to itself signals the preferred URL before parameters or scrapers create copies. On Shopify this is handled by default in `theme.liquid`, but check it—some apps and custom themes strip or break it. Screaming Frog will crawl your site and flag every missing or conflicting canonical in one pass.
Canonical tags are not redirects and don't block indexing. If you want a page gone from search, use a 301 redirect or a `noindex` tag instead—never both `noindex` and canonical on the same page, since they send contradictory instructions. Canonicals also work across domains: syndicating an article to Medium? Set the canonical on Medium's copy back to your original so you keep the ranking credit.
Common mistakes worth auditing: canonicalizing every page to the homepage (Google ignores obviously wrong canonicals), pointing to a URL that 404s or redirects, mixing canonical signals with a conflicting `hreflang` setup, and letting a staging environment ship canonicals pointing to `staging.example.com`. Each quietly kills the ranking consolidation you were trying to build.
To verify your setup, use Google Search Console's URL Inspection tool—it shows both your declared canonical and the 'Google-selected canonical.' If those two disagree, Google is overriding you, usually because internal links, sitemaps, or content signals point elsewhere. Fix the underlying signals rather than adding more tags. Consistency across links, sitemap, and canonical is what makes it stick.
Frequently asked
Is a canonical tag the same as a 301 redirect?
No. A 301 redirect sends both users and crawlers to a different URL, while a canonical tag keeps the page live and viewable but tells search engines which version to index and rank. Use redirects when a page should be gone; use canonicals when duplicates must stay accessible.
Should every page have a canonical tag?
Yes—set a self-referencing canonical on every indexable page as a defensive default. It declares your preferred URL before parameters, tracking codes, or scrapers create duplicate versions.
Does a canonical tag guarantee which URL Google ranks?
No. A canonical is a strong hint, not a command. Google can pick a different 'Google-selected canonical' if your internal links, sitemap, or content signals point somewhere else—check this in Search Console's URL Inspection tool.
Can I use a canonical tag across different domains?
Yes. Cross-domain canonicals are ideal for syndicated content—set the canonical on the republished copy to point back to your original URL so your site keeps the ranking credit.
Free, concrete, yours to keep
Want this done for you — properly?
Get a free audit of your rankings and AI-answer presence. Real findings within days, no sales deck.