Canonical Tag Generator
Generate rel=canonical tags in HTML, HTTP header, and Next.js formats. Detect self-referencing issues and common canonicalization mistakes — free, no sign-up.
Canonical URL
Generated Tags
<link rel="canonical" href="https://example.com/your-page" />Link: <https://example.com/your-page>; rel="canonical"alternates: { canonical: 'https://example.com/your-page' }<link rel="canonical" href="https://example.com/your-page" />
Paste inside the <head> section of your HTML page.
Want the Full SEO Template System?
The Complete SEO Toolkit — 11 schema templates, a technical SEO playbook, and a priority-scored audit workbook. One-time download.
Support Our Free Tools
If you find this calculator helpful, please consider supporting our work. Your contribution helps us build and maintain these free tools for everyone.
Buy me a coffeeCanonical Tag Generator — rel=canonical in Every Format, With Issue Detection
The rel=canonical tag is one of the most important — and most frequently misconfigured — technical SEO elements. This tool generates the correct canonical tag for any URL in every format you need: HTML <link> element, HTTP Link header, Next.js generateMetadata(), WordPress wp_head, and Shopify theme.liquid.
The built-in Checker mode detects 8 types of canonicalization mistakes: protocol mismatches, www inconsistencies, trailing slash differences, UTM tracking parameters, session IDs, URL fragments, uppercase path characters, and cross-domain canonicals — all the issues that silently split your page's ranking signals.
8 Common Canonical Tag Mistakes
UTM parameters in canonical URLs
utm_source, utm_medium, utm_campaign and other tracking parameters must be stripped from canonical URLs. Including them creates unique canonical URLs for every marketing campaign, defeating the purpose entirely.
HTTP vs HTTPS mismatch
If your site is HTTPS (it should be), your canonical URLs must also use https://. An http:// canonical on an HTTPS page tells Google to prefer a potentially insecure URL.
www vs non-www inconsistency
If your site serves on https://example.com and your canonical says https://www.example.com, you have split your canonical signal. Pick one and enforce it with both a canonical tag and a 301 redirect.
Fragment identifiers (#) in canonical
Google ignores everything after # in a URL. Including #section in a canonical URL effectively strips the fragment, which may point to an entirely different page than intended.
Trailing slash inconsistency
/page/ and /page are treated as different URLs by most servers. If both are accessible, one will create a duplicate content issue. Canonical tags and 301 redirects must agree on which form is preferred.
Session IDs in canonical URLs
Parameters like ?sid=abc123 or ?PHPSESSID=xyz create a unique URL for every session. Never include session identifiers in canonical URLs — they generate millions of pseudo-duplicate pages.
No self-referencing canonical
Every page should have a canonical tag pointing to itself, not just duplicate pages. Without it, Google has to guess which URL is the preferred version and may choose incorrectly.
Cross-domain canonical without control
If you add a cross-domain canonical pointing to another domain, that domain should also have signals confirming the relationship (like also having a canonical pointing back or being verified in Search Console).
Canonical vs. 301 Redirect vs. noindex
| Method | Use When | User Sees | Passes Link Equity | Google Indexes |
|---|---|---|---|---|
| rel=canonical | Both URLs should stay accessible; only one should be indexed | Both pages (both accessible) | Yes, to canonical URL | Canonical URL only |
| 301 Redirect | Old URL is retired; all traffic should go to new URL | Only the new URL | Yes, ~99% to new URL | New URL only |
| noindex | Page should be accessible but not appear in search results | The page directly | No (page not indexed) | Not indexed |
| Canonical + noindex | Rare: remove from index and signal preferred URL | The page directly | Partial | Not indexed |
Frequently Asked Questions
Does every page need a canonical tag?
Yes — Google recommends adding a self-referencing canonical tag to every page, not just duplicates. Without one, Google selects a canonical URL itself ("canonicalization"), which may not always match your preference. A self-referencing canonical is a clear, explicit signal that prevents accidental duplicate content issues from future URL changes.
How long does it take for a canonical tag to take effect?
Google respects canonical tags when it next crawls both the page and the canonical target. For small sites, this can take a few days. For large sites, it may take 2–4 weeks for canonicalization to propagate fully. Monitor progress in Google Search Console → Pages → Not indexed → Duplicate without user-selected canonical.
Can I use a canonical tag and a 301 redirect together?
Canonical tag + 301 redirect on the same URL is redundant. If you have a 301 redirect from URL A to URL B, Google follows the redirect and never sees the canonical tag on URL A. Use 301 redirects when you want to permanently retire a URL; use canonical tags when both URLs should remain accessible.
What happens if two pages point canonical tags at each other?
Google detects circular canonical chains and typically ignores both tags, selecting its own preferred canonical. This is a misconfiguration — each page should have exactly one canonical, either self-referencing or pointing to a single preferred URL.
How do I add a canonical tag in Next.js App Router?
Export an async generateMetadata() function from your page.tsx file and include alternates: { canonical: 'https://example.com/page' } in the returned object. Next.js automatically renders the <link rel="canonical"> tag in the <head>. This is the correct approach for Next.js 13+ with the App Router.
Meta Tag Generator
Generate all your SEO meta tags — title, description, Open Graph, robots — in one place.
Open toolRobots.txt Validator
Verify Googlebot can actually crawl the pages your canonical tags point to.
Open toolSERP Snippet Preview
Preview how your page's title and description look in Google search results.
Open toolExplore All Tools
134 free tools — no signup required
All 134 tools are free · No signup · No ads
