How to Use Canonical Tags: A Step-by-Step Guide to Fixing Duplicate URLs

A step-by-step guide to canonical tags, based on Google's documentation: finding duplicates, choosing methods, avoiding mistakes and verifying results.

A single wooden chess king stands among wooden pawns on a tan and black chessboard.
Photo: Reinis Brūzītis via Unsplash

Key Takeaways

A canonical tag tells search engines which URL is the main version when several URLs show the same or very similar content. Google treats it as a strong hint, not a rule, so it works best alongside redirects, sitemaps and consistent internal links.

  • Canonical tags point duplicates to one preferred URL.
  • Google treats rel="canonical" as a strong hint.
  • Redirects are the strongest canonical signal.
  • Never use robots.txt for canonicalization.
  • Check Google's chosen canonical in URL Inspection.

What a canonical tag is and why it matters

The basic definition

A canonical tag is a link element in the page head that names the preferred URL for a piece of content. Google's own example looks like this: <link rel="canonical" href="https://example.com/dresses/green-dresses" />.

Every duplicate or near-duplicate page carries the same tag pointing to that one address.

Where duplicate URLs come from

Google's canonicalization guide lists common reasons that one page ends up on several URLs:

  • Separate mobile and desktop versions of the same page.
  • HTTP and HTTPS versions, or www and non-www hosts.
  • Sorting and filtering parameters on category pages.
  • A demo or staging site that was indexed by accident.

What you gain from fixing it

Google says a clear canonical helps it consolidate signals, such as links, into one preferred URL. It also simplifies tracking, because metrics collect on one address, and saves crawl time for new or updated pages.

Google crawls the canonical page most regularly and crawls duplicates less often.

When you can skip it

Google says none of these methods is required, and a site will likely do fine without stating a preference. In that case, Google picks the version it judges best for users, which may not be the one you would choose.

Step 1: Find your duplicate URLs

Check indexing reports

Start in Google Search Console, where the page indexing report flags duplicates and alternate pages. Note any URL patterns that repeat, such as parameters or trailing slashes.

Crawl the site yourself

Run a site crawler and group pages with identical titles or body text. Pay special attention to faceted navigation, tracking parameters and printer-friendly versions.

Export the clusters to a spreadsheet with one row per duplicate and a column for the preferred URL. That sheet becomes your implementation and testing list.

Decide which version wins

For each cluster, pick the URL you want people to land on from search. Usually that is the clean HTTPS address without parameters that you already link to from menus.

Step 2: Choose the right canonical method

Redirects

Google ranks its methods by how strongly they influence canonicalization. Redirects are the strongest, and permanent redirects tell Google the redirected URL is a worse version than the destination.

Use them when the duplicate does not need to stay reachable, such as an old HTTP or non-www address.

The rel="canonical" link element

The rel="canonical" annotation is also a strong signal, and it keeps both URLs live for visitors. It suits filtered views, tracking URLs and other variants people still need to reach.

Google notes it only works for HTML pages, and the mapping can be complex to maintain on large sites.

Sitemap inclusion

Listing a URL in your sitemap is a weak signal that suggests it as canonical. It is a simple way to state canonicals for a large site, but Google still decides which pages are duplicates.

Stack the signals

Google says these methods stack and become more effective when combined. A redirect, a matching canonical tag and a clean sitemap together leave little room for doubt.

Step 3: Add the canonical tag correctly

Place it in the head

Add the link element inside the head section of every duplicate page, pointing to the preferred URL. Google's implementation guide recommends absolute URLs, since relative paths are supported but not recommended.

Use self-referencing canonicals

Give the preferred page a canonical tag that points to itself. That protects it when someone links to it with tracking parameters or a different case.

Let your CMS handle it

Many content management systems set canonical tags through a search engine settings page or plugin. Check that setting before editing templates by hand.

Handle PDFs with an HTTP header

For files such as PDFs, which have no HTML head, send a rel="canonical" HTTP header instead. The header takes the form Link: followed by the URL in angle brackets and rel="canonical".

Step 4: Avoid the common mistakes

Do not use robots.txt or noindex

Google says not to use robots.txt for canonicalization, and our robots.txt guide explains why blocked URLs can still be indexed. It also advises against noindex for choosing a canonical within a site, because noindex blocks the page from Search entirely.

Do not mix signals

Do not name one URL in a canonical tag and a different URL in your sitemap. Conflicting signals make Google more likely to pick its own choice.

Link internally to the canonical

When linking within your site, link to the canonical URL rather than a duplicate. Consistent internal links reinforce the choice you made in the tag.

Keep JavaScript from changing it

On sites that render with JavaScript, set the canonical in the HTML source and make sure scripts do not change it. If you cannot set it in the source, Google says to leave it out there and set it only with JavaScript.

Step 5: Handle special cases

Separate mobile URLs

If you run a separate mobile site, Google's guide shows the desktop page carrying a rel="alternate" link with a media query to the mobile URL. The mobile page then points back to the desktop URL with rel="canonical".

HTTPS and host variants

Google prefers HTTPS pages over HTTP versions as canonical by default. Bad TLS certificates and HTTPS-to-HTTP redirects can make it strongly prefer HTTP, and HSTS cannot override that preference.

Make sure your certificate matches the full host name, or use a wildcard certificate that covers it.

Translated and localized pages

Google treats pages as duplicates only when the main content is in the same language. Fully translated pages are not duplicates, even if headers and footers match.

For near-identical English sites in different countries, Google recommends localization annotations rather than relying on canonicals alone.

Syndicated content

Google does not recommend canonical tags for avoiding duplication with syndication partners, because their pages often differ a lot. Ask partners to block the syndicated copy from Search instead.

Step 6: Verify and troubleshoot

Use URL Inspection

Google's troubleshooting guide says the URL Inspection tool shows the canonical Google selected. Compare it with the canonical you declared for each key page.

Find out why Google disagreed

Google may choose a different canonical because of content quality or technical signals. Typical causes include incorrect canonical tags from a CMS plugin, server misconfigurations and missing localization annotations.

Request reindexing sparingly

Once you fix the issue, use Request Indexing to ask Google to reassess the page. The feature is subject to quotas, so save it for your most important URLs.

Run a GrowthCentr checklist

After changes, recrawl the site and confirm each duplicate points to one live, indexable URL that returns a 200 status. Then monitor templates and speed together with your Core Web Vitals checks after each release.

Conclusion

Canonical tags work best as part of a consistent system of redirects, sitemaps and internal links that all name the same URL. Set them on every duplicate, avoid robots.txt and noindex shortcuts, and confirm Google's choice in URL Inspection.

Frequently Asked Questions

What is a canonical tag?

A canonical tag is a rel="canonical" link element that tells search engines which URL is the preferred version of duplicate or similar pages.

Does Google always follow the canonical tag?

No, Google treats the canonical tag as a strong hint and may choose another URL because of content or technical signals.

Should every page have a self-referencing canonical?

A self-referencing canonical is a sensible default because it guards the preferred page against parameter and tracking variants.

Can I use robots.txt to fix duplicate content?

No, Google advises against using robots.txt for canonicalization because blocked URLs can still be indexed.

Should canonical URLs be absolute or relative?

Google recommends absolute URLs, because relative paths are supported but more error prone.

How do I set a canonical for a PDF?

Send a rel="canonical" HTTP header with the file, because PDFs have no HTML head for a link element.

How do I check which canonical Google chose?

Use the URL Inspection tool in Google Search Console, which shows the canonical Google selected for a URL.

Sources: Google Search Central, What is URL canonicalization; How to specify a canonical URL with rel="canonical" and other methods; Fix canonicalization issues. Figures checked 3 December 2026. This article is for information only and is not professional SEO advice.