TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Canonical tag: what it does and how to set it correctly

A canonical tag names the preferred URL among duplicate pages. Syntax, self-referencing, cross-domain, UTM and pagination cases, a 480-URL example and the mistakes that make engines ignore it.

Lin Zhou Reviewed by Emma Collins Also called rel canonical Last updated Dec 3, 2026 Glossary

Quick answer

A canonical tag is a rel="canonical" link that names the preferred URL among pages with the same or nearly the same content. Search engines treat it as a strong hint: they may index that URL, consolidate signals onto it and show it in results, but they can choose another.

What is a canonical tag?

A canonical tag is a rel="canonical" link that names the preferred URL among pages whose content is the same or nearly the same. The usual form is a <link> element in the <head> of an HTML page. Search engines read it as a statement from the site owner: if you find several addresses for this content, treat this one as the representative.

The relation is defined in RFC 6596, published by the IETF in April 2012. It says the target must contain content that is either a duplicate or a superset of the content on the referring page. A search engine may then index only the target, consolidate signals such as links onto it and show it as the representative address. That wording sets the limit of the tool: it joins copies, it does not move rankings between unrelated pages.

Google calls the tag a strong signal, not a command. Its documentation says an explicit preference is a hint, and that Google may choose another URL, for example when the pages are not as similar as the tag claims or when other signals point elsewhere.

Canonical tag syntax: HTML, HTTP header and sitemap

The HTML form sits inside <head> and carries an absolute URL:

<link rel="canonical" href="https://example.com/shoes" />

For files that have no HTML head, such as a PDF, the same relation goes into an HTTP response header:

HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://example.com/guides/sizing.pdf>; rel="canonical"
MethodWhere it goesStrength according to GoogleGood forWatch out for
<link rel="canonical">HTML <head>Strong signalParameter and path variants of web pagesAccepted only inside <head>
Link header with rel="canonical"HTTP responseStrong signalPDF and other non-HTML filesHarder to see; check it with a header request
Sitemap inclusionXML sitemapWeak signalLarge sites that want to list preferred URLsGoogle still has to match the duplicates itself
Permanent redirectServer responseStrong signalDuplicates you want to removeVisitors can no longer open the old URL

Four syntax rules prevent most accidents. Use absolute URLs: Google supports relative paths but advises against them, because a crawlable test host would then declare itself canonical. Declare one canonical per page, and do not give one URL in the header and another in the HTML. Do not point to a URL fragment (the part after #), which Google generally does not support. And do not add hreflang, lang, media or type attributes to the canonical link, because Google ignores annotations written that way.

If a script writes the tag, Google's advice is to put the canonical in the HTML source and keep JavaScript from changing it. If the source cannot carry it, leave it out of the source and set it only with JavaScript, so there are never two different answers.

When should a page point to itself or to another URL?

Self-referencing canonical. The preferred page names itself. Google recommends this, and RFC 6596 allows it. It settles the many harmless variants that other people create when they add a parameter to your link.

Tracking parameters. A campaign link such as /shoes?utm_source=newsletter serves the same content as /shoes, so its canonical should be /shoes. The tag does not redirect anyone: the visitor's address bar still holds the UTM parameters, so a script that reads the address can still record the campaign. Do not tag internal links this way; link to the clean URL inside your own site.

Cross-domain copies. The target may sit on a different host or domain, and may differ in scheme, such as http pointing to https. This suits a document that you publish on two domains you control. It is a poor fit for syndication: Google says the canonical element is not recommended for avoiding duplication by syndication partners, because the pages are often very different, and that partners should block indexing instead.

Paginated lists. Page 2 of a category is not a copy of page 1. RFC 6596 says component pages should not name the first page as canonical, because their content may then be disregarded. Google's pagination guide says the same: give each page its own canonical URL. A single "view all" page that really contains everything is a valid target, since it is a superset.

Filters and sort orders. A price-sorted page 2 holds different items from the default page 2, so it is neither a copy nor a superset. For variants you do not want in search, Google's pagination guide suggests noindex or a robots.txt rule rather than a canonical. A filter view that deserves to rank, such as a color landing page with its own title and text, should name itself.

Language versions. Google treats translated pages as duplicates only when the main content stays in the same language. With hreflang, each page should declare a canonical in its own language, or the closest substitute.

Worked example: 480 URLs for one category page

Sample data: a shoe category has four color states (all, red, black, white), four sort orders (default, price low to high, price high to low, newest), five result pages, and six address forms (clean, plus five campaign tags). The number of addresses is 4 × 4 × 5 × 6 = 480.

The team wants the color views to rank and does not want sorted views in search.

URL groupCountCalculationTreatment
Default sort, no campaign tag204 colors × 5 pagesSelf-referencing canonical
Default sort, with campaign tag10020 × 5 tagsCanonical to the matching clean URL, same color and page
Any of the three other sort orders3604 colors × 3 sorts × 5 pages × 6 formsnoindex, left crawlable so the rule can be read
Total48020 + 100 + 360

So 480 addresses reduce to 20 that are meant to appear in search. Note what the matching rule does: /shoes?color=red&page=3&utm_source=newsletter points to /shoes?color=red&page=3, not to /shoes. Cutting the whole query string with one template line is the usual way this goes wrong.

If the team decided that color views should not rank either, only the five pages of "all" in default sort would name themselves, their 25 tagged copies would point to them, and the other 450 addresses would get noindex: 5 + 25 + 450 = 480.

Common canonical tag mistakes

MistakeWhy it failsFix
Pages 2 to 5 point to page 1The target is not a duplicate; items on later pages may be disregardedEach page names itself
Every page points to the home pageSame problem across the whole siteTemplate the canonical from the page's own URL
Two tags, one from the CMS and one from a pluginThe site names two preferred URLsKeep one source of truth
Target redirects or returns a 4xx errorRFC 6596 says to avoid both; engines may ignore the tagPoint to the final URL that returns 200
A canonical chain, A to B and B to CRFC 6596 says not to name a page that points elsewherePoint A and B straight to C
Staging host in the production templateSearch engines are told the test site is preferredBuild absolute URLs from the production origin
Sitemap lists one URL, the tag names anotherConflicting signalsUse the same URL in both, and in internal links
Duplicates blocked in robots.txtThe crawler cannot read the tag, and the URL may still be indexed without contentAllow crawling; do not use robots.txt for canonicalization
Tag placed in <body>Google accepts it only in <head>Move it, and keep the head valid HTML

A chain often appears after a URL migration, when old rules point to addresses that now redirect. The same cleanup that removes a redirect chain should update canonical targets, and 404 pages should never be a target.

Canonical tag vs 301 redirect vs noindex

Canonical tag301 redirectnoindex
Can visitors open the URL?YesNo, they are sent onYes
What it says"These are copies; prefer that one""This has moved""Keep this out of search results"
Effect on signalsAsks engines to consolidate onto the targetStrong signal that the target should be canonicalThe page is dropped from Google results
Typical useParameters, print views, cross-domain copiesRetired duplicates, host or protocol movesInternal search, sorted lists, thank-you pages

The choice follows one question: should a person still be able to use this address? If not, redirect. If yes and it is a copy, use a canonical. If yes and it should simply not be found through search, use noindex, set either as a meta tag or an X-Robots-Tag header. Google advises against using noindex to steer canonical selection within one site, because it removes the page from search altogether.

How do you check which canonical Google chose?

  1. Read the HTML. Run curl -s URL | grep -i 'rel="canonical"', and for files run curl -sI URL | grep -i '^link:'.
  2. Compare in Search Console. The URL Inspection tool shows the user-declared canonical and the Google-selected canonical. If they differ, look for conflicting redirects, sitemap entries, internal links or hreflang.
  3. Check that the pages really match. If Google merged two pages you consider different, make the main content clearly distinct. Google notes that pages can stay in a duplicate cluster for up to two weeks after the fix.
  4. Remember where the data lands. Search Console assigns clicks and impressions to the canonical URL Google selected, with some exceptions, so a duplicate with no data is not necessarily broken.

Canonical URLs in TapCub

Take the 480-address example after the rules ship. TapCub does not add, edit or validate canonical tags; it measures what visitors do on those addresses.

  1. Expect one row for query variants. In Web analytics › Pages, the query string is not part of the page path, so /shoes?color=red&page=3 and a tagged copy are both counted under /shoes. Use this view for the category as a whole, not to judge single filter states.
  2. Read campaigns from the source side. In Web analytics › Sources, UTM values are read from the address of each pageview, and a session keeps the values from the page it entered on. A canonical tag does not change that address.
  3. Watch search results. With Google Search Console connected, Monitoring › Search performance shows clicks, impressions and position by page and query, usually one to three days late. A parameter URL that keeps collecting impressions is worth inspecting in Search Console.
  4. Date the change. Add a note in Configuration › Annotations on the day the new tags go live, so a later shift in organic entries can be read against it.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Lin Zhou

Product Experience Specialist

Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

Does every page need a canonical tag?

No. Google says it can usually pick a canonical on its own and a site will likely do fine without one. A self-referencing tag is still worth adding wherever parameters, tracking links or several paths can reach the same content, because it states your preference before a variant spreads.

Can a canonical tag point to another domain?

Yes. RFC 6596 allows the target on a different hostname, and Google supports cross-domain canonicals. The content must really match. For syndication partners Google does not recommend relying on it and says partners should block indexing of the copy instead.

Why did Google ignore my canonical tag?

It is a hint. Common reasons are pages that differ too much, a target that redirects or errors, two conflicting tags, a sitemap or internal links that name another URL, or a tag outside the head. The URL Inspection tool shows which canonical Google selected.

Do canonical tags remove UTM parameters from my analytics?

No. The tag is read by search engines and does not redirect the visitor or rewrite the address bar. Scripts that read the page address still see the UTM parameters. How a report groups those addresses depends on the analytics tool you use.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics