HomeAboutServices PortfolioSkillsToolsBlog ClientsContact

Canonical tag vs 301 redirect: when to use each

Key takeaways

  • A canonical tag (rel="canonical") tells search engines which URL is the preferred version of a page when duplicate or near-duplicate content exists at multiple addresses.
  • A self-referencing canonical is useful on a preferred URL, but Google does not require one on every indexable page.
  • Google treats canonical tags as a strong hint, not a directive. If your canonical conflicts with other signals (sitemaps, internal links, redirects), Google may override your preference.
  • Canonical tags and 301 redirects solve different problems. Use canonicals when both URLs must stay accessible; use 301s when the old URL should disappear completely.
  • The most common mistakes are using relative URLs instead of absolute, canonicalizing paginated pages to page one, and placing the tag in the body instead of the head.
Silhouette of a road signpost against golden sky, representing how canonical tags point search engines to the correct page

When the same content is accessible at multiple URLs, you can tell Google which version you prefer. A canonical annotation is useful when both versions need to remain available; a permanent redirect is clearer when the old URL should lead visitors to a replacement.

The problem is more widespread than most people realize. URL parameters, www versus non-www variations, HTTP versus HTTPS, trailing slashes, and sorting filters can all create dozens of URLs serving identical content. Without canonical tags, Google has to guess which version you want ranked, and it does not always guess correctly.

This guide explains what canonical tags are, how they work, when to use them, and the mistakes that cause them to fail. If you have ever seen Google indexing the wrong version of your page, this is probably why.

For an applied property example, see how to handle sold listing URLs.

What is a canonical tag?

A canonical tag is an HTML element that tells search engines which URL represents the master copy of a page. It uses the rel="canonical" attribute inside a <link> tag, placed in the <head> section of your HTML:

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

This tag suggests the preferred URL for duplicate or very similar content. Google may select another canonical if the pages or other signals do not support your choice.

Google introduced support for canonical tags in 2009 as a way for webmasters to handle duplicate content without needing server-level redirects. Before canonical tags, the only options were 301 redirects (which make the old URL inaccessible) or accepting that Google would pick a canonical on its own.

The canonical tag solved a specific problem: what do you do when you need the same content available at multiple URLs for legitimate business reasons, but want search engines to consolidate everything to one preferred version?

How canonical tags work

Google compares duplicate or very similar pages and chooses a representative URL. A rel="canonical" annotation is a strong preference signal. If Google accepts your preferred URL, it can consolidate signals from the alternate URLs and show the chosen canonical in Search; the annotation alone does not force that outcome.

The critical point that most guides skip: Google treats canonical tags as a hint, not a directive. This is different from how robots.txt (which Google must obey) or noindex tags work. Google weighs your canonical preference against other signals, including:

  • Which URL appears in your XML sitemap
  • Which URL your internal links point to
  • Which URL has more external backlinks
  • Which URL returns an HTTPS response (preferred over HTTP)
  • Which URL Google has been indexing longer

If your canonical tag says one thing but every other signal says something different, Google will override your tag. This is why canonical tags must be part of a consistent technical setup, not a standalone fix.

Why duplicate content is a problem

Ordinary duplicate content does not itself trigger a Google penalty. Managing duplicate URLs can help with crawling, reporting and choosing the URL shown in Search:

Crawl budget waste

On a large site, many duplicate URLs can use crawl resources that could go toward new or updated pages. Check crawl evidence before treating this as a priority; see the crawl budget guide.

Diluted ranking signals

Links and other signals can be associated with different duplicate URLs. A selected canonical helps Google consolidate appropriate signals; it is not a guarantee that every metric or ranking effect moves to the URL you declare.

Wrong URL in search results

Without a canonical tag, Google picks whichever version it thinks is best. This can result in a URL with tracking parameters, a print-friendly version, or a non-preferred subdomain appearing in search results. Users see an ugly URL, and you lose control over which version of your page represents you on Google.

A code editor on a laptop screen where canonical tags and other head elements are implemented

When to use canonical tags

Not every situation calls for a canonical tag. Here are the scenarios where they are the right solution:

URL parameter variations

E-commerce sites commonly have URLs like /shoes/?sort=price. If sorting only rearranges essentially the same collection, a canonical to /shoes/ may be appropriate. A filter such as ?color=red can produce a distinct, useful collection; decide whether it deserves its own indexable URL before pointing it at the base category.

WWW vs. non-www and HTTP vs. HTTPS

If your site is accessible at http://example.com, https://example.com, http://www.example.com, and https://www.example.com, that is four versions of every page. Canonical tags (combined with 301 redirects) should point everything to one version, typically https://www.example.com or https://example.com.

Content syndication

When an approved partner republishes substantially the same article, ask whether its platform supports a cross-domain canonical to your original. Verify the rendered tag and Google's selected canonical; the tag cannot guarantee which domain appears in Search.

Mobile and AMP pages

If you maintain separate mobile URLs (such as m.example.com), follow Google's paired canonical and mobile alternate annotations. Mobile-first indexing describes which version Google primarily uses for indexing; it does not automatically make the mobile URL the canonical.

Product pages in multiple categories

An e-commerce product that appears under /men/shoes/sneakers/ and /sale/sneakers/ is the same page at two URLs. The canonical tag should point to the primary category URL you want ranking.

Trailing slash variations

If /about and /about/ both resolve to the same page, pick one format and canonicalize to it. This applies site-wide and should be handled consistently in your technical SEO setup.

Self-referencing canonical tags

A self-referencing canonical is a canonical tag that points to the page it is on:

<!-- On the page https://example.com/blog/seo-guide/ -->
<link rel="canonical" href="https://example.com/blog/seo-guide/" />

This might seem redundant, but it is one of the most important defensive practices in technical SEO. Here is why:

  • URL parameters: if someone shares your page with ?utm_source=twitter appended, the self-referencing canonical tells Google to ignore the parameter version
  • Session IDs: some CMS platforms append session IDs to URLs, creating unique URLs for each visitor
  • Accidental duplicates: if your CMS generates the same page at /page and /page/, the canonical catches it
  • Scrapers and republishers: if someone copies your page and forgets to remove the canonical tag, it points back to you

Google recommends a self-referencing canonical on your preferred URL, but it also says a site can do fine without declaring one. Use it consistently where it helps clarify your preferred URL; this page has one in its source code.

Cross-domain canonical tags

Cross-domain canonicals point from a page on one domain to a page on a different domain. They tell Google: "The original version of this content lives on that other website."

<!-- On partner-site.com/article-title/ -->
<link rel="canonical" href="https://bikeshtamang.com.np/blog/article-title/" />

When to use cross-domain canonicals

  • Content syndication: you publish an article on your blog, then republish it on Medium or a partner site. The republished version canonicalizes to your original.
  • Franchises and multi-site businesses: a parent company syndicates content to regional domains. Each regional page canonicalizes to the parent domain's original.
  • Migrated content: after a domain migration, if some old URLs still serve content, canonical tags can point to the new domain until 301 redirects are fully in place.

Risks of cross-domain canonicals

Cross-domain canonicals are powerful but risky. If the syndication partner controls the tag, they could remove it and claim the content as their own. Always verify that cross-domain canonicals stay in place after syndication. If you are syndicating to a platform you do not control (like Medium), check periodically that the canonical tag has not been stripped.

Canonical tags vs. 301 redirects

Choose by the visitor experience first: should someone opening the old URL see that URL's content, or be taken to a replacement? Google's canonical documentation treats both redirects and canonical annotations as strong signals, with redirects the stronger of the two. Neither guarantees Google's final selection.

  • Canonical tag: both URLs remain accessible. Users can visit either one. Search engines consolidate signals to the preferred URL but do not remove the duplicate from their awareness.
  • 301 redirect: the old URL sends users and search engines to the new one. The old URL is no longer directly accessible. Link equity transfers to the new URL.

Use a canonical tag when:

  • Both URLs must remain accessible for users (e.g., filtered product pages)
  • You syndicate content to another domain and cannot control their server configuration
  • You want to consolidate parameter variations without blocking access

Use a 301 redirect when:

  • A page has permanently moved to a new URL
  • You are merging duplicate pages into one
  • You are migrating from HTTP to HTTPS or changing domains
  • You are cleaning up old URLs that should no longer exist

A common mistake is using canonical tags when a 301 redirect is the right choice. If users should never land on the old URL, redirect them. A canonical tag leaves the old page accessible, which can confuse users and create a poor experience.

Decision table: URL change or duplicate view?

SituationRecommended signalReason
A page moved permanently and the old URL should stop loading301 or 308 redirectUsers and crawlers go to the replacement URL.
Two URLs serve duplicate or very similar content and both must stay accessibleCanonical from the duplicate to the preferred URLUsers can still open either version; Google treats the tag as a strong hint.
Two pages share a keyword but answer different intentsKeep separate, self-referencing canonicalsCheck whether the pages genuinely compete; a shared keyword alone does not make them duplicates.
A temporary A/B test uses a separate URLCanonical to the original, or a temporary 302 when redirecting test visitorsA permanent redirect incorrectly signals that the test URL is a permanent move.
A tracking parameter creates the same page at a second URLCanonical to the clean URL; avoid internal links to the parameter URLThe page can still open with its tracking parameter while the preferred URL is clear.
A filtered category has a distinct product selectionEvaluate the filtered page separatelyDo not canonicalize genuinely useful, distinct content to the broad category by default.

Side-by-side example: one product, two URLs

Suppose /products/red-shoes/ is the permanent replacement for /old-red-shoes/. Return 301 from the old URL with a Location: https://example.com/products/red-shoes/ header. A visitor opening the old URL reaches the new product page. Update internal links and the sitemap to the destination.

Now suppose /products/red-shoes/?sort=reviews must still show a sorted view of substantially the same product. Let that URL return 200 and place <link rel="canonical" href="https://example.com/products/red-shoes/"> in its HTML head. A visitor can still use the sorted view; Google receives your preferred search URL. If the alternate page answers a different need, keep it separate instead.

For a more detailed explanation of permanent versus temporary redirects, see the 301 vs 302 guide. Google's canonical guidance describes redirects and canonical tags as strong signals, but neither is an absolute command; Google selects its own canonical. Its A/B testing guidance recommends temporary redirects for redirect-based tests.

Check the implementation

  1. Open the old URL in a private browser tab. If it is meant to move, confirm that visitors land on the new URL and the response is a permanent redirect.
  2. For a canonical, view the HTML of the secondary URL. Check that its <link rel="canonical"> points to the preferred, live URL and that both pages still load.
  3. Inspect the URLs in Search Console to compare your declared canonical with Google's selected canonical after it has recrawled the pages.

How to implement canonical tags

In raw HTML

Add the canonical tag inside the <head> section, before any scripts or stylesheets:

<head>
  <link rel="canonical" href="https://example.com/your-page/" />
</head>

In WordPress

If you use Rank Math or Yoast, both plugins add self-referencing canonicals automatically. You can override the canonical URL in each post's SEO settings panel. For custom canonical URLs, look for the "Canonical URL" field in the plugin's advanced settings for each page.

In Next.js / React

Use the <Head> component (Next.js Pages Router) or the metadata API (App Router):

// Pages Router
import Head from 'next/head';
<Head>
  <link rel="canonical" href="https://example.com/page/" />
</Head>

// App Router (layout.tsx or page.tsx)
export const metadata = {
  alternates: { canonical: 'https://example.com/page/' }
};

Via HTTP header

For non-HTML files (PDFs, images), you can set the canonical via an HTTP response header:

Link: <https://example.com/report.pdf>; rel="canonical"

This tells Google which version of a PDF or document to index when it is accessible at multiple URLs.

In your XML sitemap

Your sitemap should only include canonical URLs. If a page has a canonical tag pointing elsewhere, do not include the non-canonical URL in your sitemap. Conflicting signals between your sitemap and canonical tags confuse Google and increase the chance of your preference being overridden.

8 canonical tag mistakes that break SEO

1. Using relative URLs instead of absolute

A relative canonical like <link rel="canonical" href="/page/" /> can be misinterpreted depending on the server configuration, especially when the page is accessed through different protocols or subdomains. Always use the full absolute URL: https://www.example.com/page/.

2. Placing the tag in the body

Canonical tags belong in the <head> section. If your tag appears inside <body>, Google ignores it. This commonly happens when a CMS injects the tag through a content area instead of the header template, or when JavaScript inserts it too late in the DOM.

3. Multiple canonical tags on one page

A page should have one unambiguous canonical preference. Conflicting tags from a plugin and theme can cause Google to ignore the declared preference. Check your page source and any HTTP Link header for conflicting values.

4. Canonicalizing paginated pages to page one

Page two of an archive usually lists different items from page one. Pointing its canonical at page one can cause Google to disregard page two as a separate URL. Give each meaningful paginated page its own URL and usually its own canonical; keep its links crawlable.

5. Pointing to a noindexed or blocked page

If your canonical URL has a noindex meta tag, or is blocked by robots.txt, you are telling Google: "The preferred version of this page is a page you should not index." This creates a conflict that Google resolves unpredictably. Make sure your canonical target is always a crawlable, indexable page.

6. Canonical pointing to a 404 or redirect

A canonical URL that returns a 404 error or redirects to a different page sends broken signals. Google cannot consolidate ranking signals to a page that does not exist. Audit your canonical tags regularly to catch URLs that have been deleted or moved without updating the canonicals on related pages.

7. HTTP canonical on an HTTPS page

After migrating to HTTPS, many sites forget to update their canonical tags. The page loads on HTTPS but the canonical still points to the HTTP version. This creates a conflict: Google sees HTTPS signals everywhere except in the canonical tag, which says to prefer HTTP. Update all canonical tags during any protocol migration.

8. Canonical chains

Page A canonicalizes to page B, and page B canonicalizes to page C. These chains slow down signal consolidation and increase the risk that Google ignores the chain entirely. Every canonical tag should point directly to the final preferred URL, never through intermediaries.

For Shopify product paths, use the Shopify duplicate product URL audit to compare collection links with canonical output and preserve selected variants during a targeted theme change.

How to audit your canonical tags

Regular audits catch canonical tag problems before they erode your rankings. Here is a practical audit process:

Step 1: Crawl your site

Use a crawler like Screaming Frog, Sitebulb, or Ahrefs Site Audit to extract the canonical tag from every page on your site. Export the URL and its canonical value into a spreadsheet.

Step 2: Check for missing canonicals

Filter for missing or conflicting canonicals on duplicate URL groups and important preferred pages. Google can choose a canonical without a declared tag, so prioritize cases where its chosen URL differs from the one you intend.

Step 3: Validate canonical targets

For pages where the canonical points to a different URL, verify that the target URL returns a 200 status code, is not noindexed, is not blocked by robots.txt, and actually contains the same or similar content as the page you are canonicalizing.

Step 4: Check Google Search Console

In Google Search Console, go to the "Pages" report and filter by "Duplicate without user-selected canonical" and "Duplicate, Google chose different canonical than user." These reports show you where Google is ignoring your canonical tags, which usually indicates one of the mistakes listed above.

Step 5: Cross-reference with your sitemap

Compare your sitemap URLs against your canonical URLs. If a URL appears in your sitemap but its canonical points elsewhere, remove it from the sitemap. Your sitemap should only contain the canonical version of each page.

Run this audit as part of your regular SEO audit process. Quarterly is sufficient for most sites, though large e-commerce sites with frequent URL changes should check monthly.

Frequently asked questions

What is a canonical tag?

A canonical tag is an HTML element placed in the <head> section of a web page that tells search engines which URL is the preferred version of that page. It uses the syntax <link rel="canonical" href="https://example.com/preferred-page/" />. When multiple URLs serve the same or very similar content, the canonical tag points search engines to the version you want indexed and ranked. Google treats the canonical tag as a strong hint, not an absolute directive, meaning it will usually follow your preference but may override it if other signals conflict.

Should every page have a canonical tag?

No. Google recommends a self-referencing canonical on a preferred URL, but does not require every indexable page to declare one. It helps make your preference explicit, especially when URL variants exist. Keep canonical tags, redirects, internal links and sitemap URLs consistent.

What is the difference between a canonical tag and a 301 redirect?

A canonical tag keeps both URLs accessible to users while telling search engines to consolidate ranking signals to the preferred version. A 301 redirect physically sends users and search engines from the old URL to the new one, making the old URL inaccessible. Use a 301 redirect when a page has permanently moved. Use a canonical tag when both URLs need to remain accessible, such as when the same product appears under multiple category URLs on an e-commerce site.

Can canonical tags point to a different domain?

Yes, for duplicate or very similar content when the other site supports the annotation. Ask the publishing partner to add the canonical to the syndicated copy and verify it after publishing. Google can still choose another URL, so the tag does not guarantee your domain will rank.

Need help fixing canonical tag issues or running a technical SEO audit? I offer technical SEO services that include canonical tag audits, duplicate content resolution, and full site crawl analysis. Or start with a complete SEO audit to identify all the technical issues holding back your rankings. Get in touch to discuss your project.

B
Bikesh Tamang
SEO Specialist & front-end developer in Kathmandu, Nepal, helping businesses rank higher and turn traffic into customers. More about me →