Canonical Tag Generator — rel=canonical for Any URL
Generate the correct <link rel="canonical"> tag instantly. Single URL with live validation and normalisation preview, or bulk mode for multiple URLs at once. Strip UTM parameters, enforce HTTPS, get HTML tag, HTTP header, or CMS snippet output. Free, no account required.
Enter your preferred URL — get the correct rel=canonical tag instantly
Enter a URL above and click “Generate canonical tag”.
Rate this tool
How to generate a canonical tag
Everything a canonical tag generator needs
LazyTools vs other canonical tag generators
| Feature | LazyTools | SEO Toolbelt | BigFunApp | MeasureSEO |
|---|---|---|---|---|
| Bulk mode | ✅ Unlimited URLs | ✅ Multi-URL | ❌ Single only | ✅ Bulk |
| Live URL validation | ✅ Real-time | ❌ No | ❌ No | ❌ No |
| Normalisation preview | ✅ Before/after | ❌ No | ❌ No | ❌ No |
| UTM parameter stripping | ✅ Yes | ✅ Yes | ❌ No | ❌ No |
| CMS implementation snippets | ✅ WP + Shopify + HTTP | ❌ No | ❌ No | ❌ No |
| Download output | ✅ .txt file | ✅ CSV | ❌ No | ❌ No |
| Session/ref param stripping | ✅ Yes | ⚠ Partial | ❌ No | ❌ No |
| Account required | ✅ None | ✅ None | ✅ None | ❌ Account |
Canonical Tags — Complete Guide to rel=canonical for SEO
The canonical tag (<link rel="canonical">) is one of the most powerful and widely misunderstood tools in technical SEO. Used correctly, it prevents duplicate content from diluting your rankings, consolidates link equity to the URLs that matter, and gives search engines clear signals about your site structure. Used incorrectly — or not at all — it leaves search engines to make guessing decisions that may not align with your SEO strategy.
What does a canonical tag look like?
The canonical tag goes inside the <head> section of every page that has or could have duplicate versions:
<!-- Standard HTML canonical tag --> <link rel="canonical" href="https://example.com/your-preferred-page/" />
The href attribute must contain an absolute URL — the full URL including protocol (https://), domain, and path. Relative URLs (/page/) are not valid for canonical tags.
When to use a canonical tag
| Scenario | Canonical solution | Example |
|---|---|---|
| URL parameter duplicates | Canonical to clean URL | /product?sort=price → /product/ |
| UTM tracking links | Strip UTM, canonical to base | /page?utm_source=email → /page/ |
| HTTP vs HTTPS | Canonical to HTTPS version | http://example.com → https://example.com |
| www vs non-www | Canonical to preferred version | www.example.com → example.com (or vice versa) |
| Trailing slash variants | Canonical to consistent form | /page and /page/ → pick one |
| Paginated content | Canonical page 2+ to page 1 | /blog/page/2/ → /blog/ |
| Syndicated content | Cross-domain canonical | partner-site.com → your original article |
| Every page (defensive) | Self-referencing canonical | /page/ → /page/ (same URL) |
Canonical tag vs 301 redirect — which to use?
| Method | User experience | Crawling | Best use case |
|---|---|---|---|
| Canonical tag | Both URLs work | Both crawled | URLs must remain accessible at all addresses |
| 301 redirect | Old URL redirects to new | Old URL not crawled after redirect | Page permanently moved, old URL no longer needed |
Rule of thumb: use a 301 redirect when the old URL should no longer exist. Use a canonical tag when the page needs to be accessible at multiple URLs (e.g. tracking parameter URLs that analytics depends on).
Canonical tags and URL parameters
URL parameters are one of the most common sources of duplicate content. An e-commerce site with product sorting, filtering, and session tracking can generate dozens of URL variants for a single page:
https://shop.com/shoes/ ← canonical target https://shop.com/shoes/?sort=price https://shop.com/shoes/?color=red https://shop.com/shoes/?utm_source=google https://shop.com/shoes/?sid=abc123
The canonical tag generator above strips UTM, session, and ref parameters automatically, ensuring your generated canonical always points to the clean URL. Use the parameter stripping options to control which parameters are removed before generating the tag.
Self-referencing canonical tags
Google recommends adding a self-referencing canonical tag to every page — not just pages with known duplicates. Even a page with no current duplicates can develop them from:
- Analytics tools appending UTM parameters to shared links
- CDN variants or AMP versions of pages
- Printer-friendly URLs generated by CMS themes
- Social sharing buttons that add tracking parameters
- A/B testing tools that add URL parameters
A self-referencing canonical is a one-line defensive measure that costs nothing and prevents potential duplicate content dilution.
How to add a canonical tag in WordPress
Yoast SEO (recommended): Edit the post/page → scroll to Yoast SEO meta box → Advanced tab → Canonical URL field. Enter your preferred URL. Yoast outputs the canonical in the page head automatically.
Rank Math: Edit post/page → Rank Math panel → Advanced → Canonical URL field.
Manually (functions.php): The WordPress PHP snippet in the tool above adds a dynamic self-referencing canonical using get_permalink() for all pages. This is a good fallback if no SEO plugin manages canonicals.
Common canonical tag mistakes to avoid
| Mistake | Impact | Fix |
|---|---|---|
| Relative URL in canonical | Ignored by Google | Always use absolute URLs (https://example.com/page/) |
| Multiple canonical tags | Both ignored | One canonical per page only — check for plugin conflicts |
| Canonical points to redirected URL | Passed as hint | Canonical should point to the final destination URL |
| HTTP canonical on HTTPS site | Mixed signals | Always use HTTPS in canonical — use Force HTTPS option above |
| Canonical pointing to noindex page | Conflicting signals | Don't noindex a page you've set as the canonical target |
| Canonicalling all pages to homepage | Major SEO error | Canonical should point to the most similar/relevant URL |
Canonical tag generator FAQ
A canonical tag (rel=canonical) tells search engines which version of a URL is preferred for indexing. Syntax: link rel="canonical" href="https://example.com/page/" in the head section. Consolidates link equity, prevents duplicate content issues, and guides search engines to show the right URL in results.
A canonical tag that points to the page's own URL. Recommended by Google on every page, even without known duplicates. Protects against UTM parameters, CDN variants, and AMP versions creating unintentional duplicates. Generate yours above and add it to every page.
Use it when: same content is at multiple URLs (www/non-www, http/https), URL parameters create duplicates (sort, filter, UTM, session IDs), content is paginated or syndicated, or as a self-referencing defensive canonical on every page.
301 redirect: old URL stops working, use when a page permanently moved. Canonical: both URLs remain accessible, search engines consolidate signals to canonical. Use 301 when the old URL is no longer needed. Use canonical when both URLs must stay live (e.g. tracked URLs analytics depends on).
Yes — cross-domain canonicals are supported. Add the tag on the syndicated copy pointing to the original: link rel="canonical" href="https://originaldomain.com/article/". Google treats cross-domain canonicals as hints, not directives. Use them when your content is published on partner sites.
Google will likely ignore both and determine its own canonical. Multiple canonical tags are a technical error. Common cause: a WordPress theme hardcodes a canonical AND a plugin adds another. Audit using browser DevTools (view page source, search for "canonical") to find conflicts.
Yes. Google recommends self-referencing canonicals on every page. Even pages without current duplicates can be affected by UTM parameters added to shared links, AMP versions, or CDN URL variants. Use bulk mode above to generate self-referencing canonicals for all your URLs at once.
Best options: Yoast SEO (Advanced tab in post editor, Canonical URL field), Rank Math (Advanced tab), or manual via functions.php. Use the WordPress PHP snippet in the generator above. Plugin approach recommended for ongoing management.
Strip: UTM (utm_source, utm_medium, utm_campaign, utm_content, utm_term), session IDs (sessionid, PHPSESSID, sid), ref/affiliate (ref, referrer, affiliate, aff_id). Keep: parameters that change page content (page, id, category, q/search). The generator above strips these with one click.
Canonical: page stays indexable; consolidates signals to the canonical URL. Use when the preferred version should rank. Noindex: page excluded from search results entirely. Use when the page should never appear in search. Don't noindex a page that is set as the canonical target — conflicting signals.
Yes. Canonical tags consolidate link equity (PageRank) to the canonical URL. Links pointing to tracked or parameter variants flow to the clean canonical URL. This is a key SEO benefit — it prevents link equity from being split across URL variants.
The LazyTools Canonical Tag Generator is 100% free with no account required. Single URL with normalisation options, or bulk mode for unlimited URLs. Four output formats, parameter stripping, live validation, download as .txt. No limits, no account.
Shopify auto-generates canonicals for products and collections. For custom pages: edit theme Liquid templates, add the canonical tag using {{ canonical_url }} variable in the head section. Copy the Shopify Liquid snippet from the generator above. For advanced canonicalization (cross-domain, filtered URLs), use a Shopify SEO app.