a canonical tag is one line of HTML, <link rel="canonical" href="https://example.com/page/">, placed in the <head> of a page. It tells search engines which URL is the main copy when visitors can reach the same content at several addresses. Google treats it as a strong hint, not an order. So it works when your other signals agree with it, and Google ignores it when they don’t.
This guide covers the situations where you actually need the tag, and the setups for HTML, WordPress and Shopify. It then lists the mistakes that make Google pick another URL, and shows how to check the result in Google Search Console.
What a canonical tag is, and what a canonical URL is
A canonical URL, or canonical version, is the address you want search engines to index and show: the preferred version of the page. Every other URL that serves the same content is a duplicate, or a near-duplicate, of that main page. The canonical tag is the HTML element that names this preferred URL.
The syntax is short:
<link rel="canonical" href="https://www.example.com/blue-running-shoes/" />
The rel="canonical" attribute says what the link means. The href attribute holds the preferred URL, written in full with protocol and domain. Google, Yahoo and Microsoft introduced the tag together in February 2009. It became a formal web standard in April 2012, published by the IETF (Internet Engineering Task Force) as RFC 6596, a numbered Request for Comments.
Most pages simply point to themselves. SEO specialists call this a self-referencing canonical tag, and it’s a sensible default on every indexable page. It protects the page when someone links to it with a tracking parameter or when your CMS (content management system, such as WordPress) creates a second address for it.

How Google uses rel=canonical: a hint among several signals
The mechanism is worth knowing, because it explains every mistake later in this guide. First, Google groups pages whose main content is the same or very similar into a cluster. Then it picks one page per cluster as the canonical. Google crawls that page most often and shows it in search results, and it crawls the duplicates less.
Your tag is only one input to that choice. Google’s documentation lists the signals you control, from strongest to weakest:
- a permanent redirect (301 or 308), which is the strongest signal;
- the
rel="canonical"link element, in HTML or in an HTTP header; - inclusion in your XML (Extensible Markup Language) sitemap, the file that lists your URLs for search engines, which is a weak signal.
Google also weighs things you may not think of as signals: internal links, the HTTPS version over HTTP, and the URL you list in hreflang annotations. When all of these ranking signals point to the same address, Google almost always respects the tag. When your menu links to one URL, your sitemap lists a second and your tag names a third, Google makes its own decision.
What consolidation gives you is practical. Links pointing at the duplicates count toward the canonical page, which is often called consolidating link equity. Your crawl budget, meaning the number of URLs Google is willing to crawl on your site, goes to pages that matter. And your reports stop splitting one page’s performance across five addresses.
When you need a canonical tag
Duplicate URLs appear more often than most site owners expect. A single article can usually be reached with and without www, over HTTP and HTTPS, and with or without a trailing slash. Here are the cases where the tag earns its place.
Tracking parameters and UTM links
Campaign links add UTM parameters (Urchin Tracking Module tags, read by analytics tools) to the end of a URL, such as ?utm_source=newsletter. The page is identical, yet the address is new. A self-referencing canonical on the clean URL tells Google to ignore the parameter version. For a marketing site that runs email, social and paid campaigns, this is the most common case by far.
Faceted navigation, filters and sorting
Online shops generate URLs like /shoes?color=red&size=10&sort=price. Those filtered pages are useful to visitors, so you can’t redirect them. Point their canonical at the main category, /shoes, unless a filtered page targets a real search of its own (for example “red running shoes”). In that case, give it unique content and let it canonicalize to itself.
Products listed in several categories
Some platforms build product URLs from the category path, so the same product lives at /men/sneakers/model-x and /sale/model-x. Pick one path as the canonical and link to that one internally. The same logic applies to product variants: a size or colour variant with no distinct content should point to the parent product.
HTTP, HTTPS, www and non-www duplicates
A 301 redirect fixes protocol and hostname duplicates better, because visitors should never land on the HTTP version. Add the tag on top, with the HTTPS address you actually use. Choosing www or non-www doesn’t matter for ranking; being consistent does.
Syndicated and republished content
If your article is republished on a partner’s site, a cross-domain canonical pointing back to your original can help Google credit your version. Google has supported cross-domain canonicals since December 2009.
Be aware of a change in Google’s guidance, though: Google’s documentation now says the canonical tag isn’t recommended for syndication partners, because the copied pages are often quite different from the original. Its advice is to ask partners to add a noindex to the copy instead. If that isn’t possible, ask for a canonical plus a clear link back to your article.
Print versions, PDFs and other file formats
A printable page or a PDF version of a guide duplicates its HTML page. HTML pages take the link element, but a PDF has no <head>. For files, you send the canonical in an HTTP header, as shown in the setup section below.

When not to use a canonical tag to another page
Some pages look like duplicates but aren’t. Pointing them elsewhere removes them from search.
Paginated series: don’t point everything to page 1
It seems natural to canonicalize pages 2, 3 and 4 of a blog archive to page 1. It’s a mistake.
Those pages list different articles, so they aren’t duplicates, and the posts linked only from page 3 become harder for Google to find. Google’s guidance on pagination is to give each page its own self-referencing canonical. Note also that Google stopped using rel="prev" and rel="next" as an indexing signal in 2019, so those tags won’t do the job either.
Similar pages that are not duplicates
Location pages, city landing pages and event listings often share most of their template text. If you want each of them indexed, each must keep a self-referencing canonical. Cross-canonicalizing them to one master page tells Google to drop the others. The real work there is making each page useful on its own, with local details, specific offers or real listings.
Canonical tag, 301 redirect, noindex or hreflang: which one to use
These tools solve different problems, and mixing them up causes most of the damage seen on real sites. A redirect is a directive that moves people and crawlers. A canonical is a hint that leaves both URLs working. A noindex removes a page from the index without consolidating anything. The Complete Canonical Tag Guide is a useful companion to this.
| Your situation | Use | Avoid |
|---|---|---|
| The duplicate page should no longer exist (old URL, migration, HTTP version) | 301 redirect to the new URL | A canonical alone: visitors still land on the old page |
| Both URLs must stay live (filters, UTM links, print version) | rel=canonical to the main URL | A redirect, which breaks the filter or the tracking |
| A page has no search value at all (internal search results, thank-you page) | noindex | noindex and a canonical to another page on the same URL |
| Language or country versions of the same page | hreflang, with a self-referencing canonical on each version | Canonicalizing all versions to the English page |
| Your content republished on another domain | noindex on the partner’s copy, or a cross-domain canonical | Leaving the copy indexed with no signal back to you |
| A PDF or other non-HTML file | Canonical in the HTTP Link header | Trying to edit the file to add HTML |
One objection comes up often: “why not just noindex the near-duplicate page?” Because a noindexed page passes its signals nowhere. If a service page and your home page compete for the same query, we think rewriting one of them to target a different intent is the better option than hiding it.
How to add canonical tags: HTML, HTTP header, WordPress and Shopify
Manually in HTML
Add the link element inside the <head> section of the page, once, with an absolute URL:
<head>
<link rel="canonical" href="https://www.example.com/services/seo-audit/" />
</head>
On a hand-coded site, set it in the page template, so every new page receives its own self-referencing URL automatically. A hard-coded address copied into a shared template is the classic way to send every page’s canonical to the home page.
In the HTTP header, for PDFs and files
The server sends the canonical with the file. On Apache, a rule in .htaccess can add it:
<Files "seo-guide.pdf">
Header add Link "<https://www.example.com/seo-guide/>; rel=\"canonical\""
</Files>
The response then contains Link: <https://www.example.com/seo-guide/>; rel="canonical". You can confirm it in your browser’s developer tools, under the Network tab.
In WordPress
WordPress itself prints a self-referencing canonical on single posts and pages. SEO plugins take over and extend this to archives and other templates. To set a custom canonical for one page:
- Yoast SEO: open the post, go to the Yoast SEO panel, then Advanced, and fill in Canonical URL.
- Rank Math: open the Rank Math panel, then the Advanced tab, and fill in Canonical URL.
- AIOSEO (All in One SEO): the plugin’s settings for each post include a custom Canonical URL field; its documentation shows where to find it in your version.
Leave the field empty for normal pages, since the plugin already writes the self-reference. Run only one SEO plugin at a time, otherwise you’ll often end up with two canonical tags on the same page.
In Shopify
Shopify themes output the tag in theme.liquid with the line <link rel="canonical" href="{{ canonical_url }}">. Product pages reached through a collection path canonicalize to the main /products/ URL by default. Check that your theme still contains this line after a theme change, and don’t add a second, hard-coded one. For anything more specific, you edit the Liquid template or use an app.

Common canonical mistakes that make Google ignore the tag
Each of these produces the same symptom: Google picks a URL you didn’t choose. Here they are in the format symptom, cause, fix.
- The canonical points to a 404, a 5xx error or a redirect. Cause: someone changed or deleted the target URL. Fix: point to the final live URL, which must return a 200 status code.
- The page has a canonical and a noindex. Cause: two contradictory instructions, “index that URL” and “don’t index this one”. Fix: keep one. Use the canonical if you want consolidation, noindex if you want removal.
- Multiple canonical tags appear in the source. Cause: a theme and a plugin both write one, or two plugins compete. Fix: disable one output. When the tags disagree, Google may ignore both.
- The tag sits in the body. Cause: a script or a page builder injects it after the
<head>, or an invalid element closes the head early. Google only acceptsrel="canonical"in the head. - Relative or wrong-protocol URLs. Cause:
href="/page/"orhttp://on an HTTPS site. Fix: use absolute URLs with HTTPS. Google supports relative paths but recommends absolute ones, because a relative path breaks easily on staging copies. - Canonical chains. Cause: page A points to B, which points to C. Fix: point every duplicate straight to the final URL.
- The canonical is blocked by robots.txt. Cause: Google can’t crawl the target, so it can’t read the content or confirm the pairing. Google’s documentation also says not to use robots.txt for canonicalization at all.
- Hreflang and canonical disagree. Cause: on a multilingual WordPress site, the canonical of the French page points to the English one, while hreflang lists the French URL. Fix: each language version canonicalizes to itself, and the hreflang set lists those same URLs.
One more trap hits sites after a redesign or a platform change. Your sitemap still lists old URLs, or your internal links use the non-canonical form. The tag says one thing and the rest of your site says another, so the tag loses.
How to check canonical tags in Google Search Console
One page: URL Inspection
Paste the URL into the search bar at the top of Search Console. Open the Page indexing section of the result.
You’ll see two lines: User-declared canonical, which is what your tag says, and Google-selected canonical, which is what Google chose. If they match, you’re done. If they differ, look for a conflicting signal from the list of mistakes above.
The whole site: the Page indexing report
Go to Indexing, then Pages, and read the reasons pages aren’t indexed. Three statuses concern canonicals:
- Alternate page with proper canonical tag: the page points to another URL, and Google agreed. This is normal and needs no fix.
- Duplicate without user-selected canonical: Google found duplicates with no canonical tag and chose one itself. Add a tag.
- Duplicate, Google chose different canonical than user: Google disagreed with your tag. Find the conflicting signal.
The first status scares many site owners, especially right after a migration, when dozens of URLs appear in it at once. It isn’t an error.
Open the list and check what’s in it: UTM versions, old platform URLs or mobile variants are fine there. Real pages you want indexed are not, and their canonical needs fixing. In our view, starting a validation on this status is pointless, since it doesn’t describe an error.
At scale: a crawler
For a site with more than a few dozen pages, run a crawler. The free version of Screaming Frog crawls up to 500 URLs, and its Canonicals tab sorts pages into filters such as Missing, Canonicalised, Non-Indexable Canonical and Canonical Is Relative. For a quick check of one page, view the source (Ctrl+U in Chrome) and search for canonical.

What to fix first on a marketing site
You don’t need to audit everything in one afternoon. We suggest this order, because it follows the impact:
- Make sure HTTP, non-preferred hostname and trailing-slash variants redirect with a 301.
- Confirm every indexable page carries one self-referencing canonical in absolute HTTPS form.
- Fix canonicals that point to errors, redirects or noindex pages.
- Handle parameters: UTM links, filters and sorting.
- Align sitemaps, internal links and hreflang with your canonical URLs.
To measure the result, compare the number of pages under “Duplicate, Google chose different canonical than user” before and after your changes. That count should fall over the following weeks, as Google recrawls the pages.
Canonical tag best practices: checklist
- One
rel="canonical"per page, inside the<head>. - Absolute URL, with the protocol and hostname you actually use.
- Target returns 200, is indexable and isn’t blocked by robots.txt.
- No canonical combined with noindex.
- No chains: duplicates point straight to the final URL.
- Paginated pages canonicalize to themselves.
- Language versions canonicalize to themselves, matching hreflang.
- Sitemap and internal links use canonical URLs only.
- PDFs and files use the HTTP Link header when needed.
- URL Inspection shows the same user-declared and Google-selected canonical on your key pages.
FAQ
Does a canonical tag pass all link equity to the main page?
Google consolidates signals from the duplicates onto the URL it selects as canonical, so links to the duplicates aren’t wasted. In practice, treat consolidation as reliable when the pages are true duplicates and your signals agree. Canonical Tags 101: Everything You Need to Know covers this in more depth.
If a page has no canonical tag, will Google stop indexing it?
No. A missing tag doesn’t mean noindex. Google simply chooses the canonical itself, and it may pick a variant you wouldn’t have chosen.
Is there a duplicate content penalty that canonical tags protect me from?
Google’s documentation says duplicate content on a site isn’t grounds for action unless it’s meant to deceive or manipulate results. The real cost of duplicate content issues is diluted signals and wasted crawling, which is what the tag addresses.
Can I canonicalize a page that isn’t an exact copy?
Yes, as long as the main content is substantially the same, such as similar content sorted or filtered differently. If the pages differ in substance, Google will likely ignore the tag, and you would lose the page you hid.
How long does Google take to respect a new canonical?
It changes when Google recrawls the duplicate and the target, so the delay depends on how often your pages are crawled. You can request indexing for a few important URLs through URL Inspection to speed up the check.
Next step
Pick your five most important pages, run each one through URL Inspection, and compare the user-declared and Google-selected canonicals. If they match, your setup is sound and you can move on to parameters and filters. If they don’t, the list of mistakes above tells you where to look, and fixing one template usually fixes hundreds of URLs at once.
For more practical guides on technical SEO and web marketing, keep browsing Internet Wonders eZine. Someone has put together a good summary of it.
