Canonical Tag Generator — rel=canonical HTML, Bulk & URL Cleaner | LazyTools
🔗 Canonical Tag Generator

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.

Single + bulk mode Live URL validation Strip UTM/session params Force HTTPS 3 output formats CMS snippets
ADSENSE — 728×90 LEADERBOARD
🔗 Canonical Tag Generator

Enter your preferred URL — get the correct rel=canonical tag instantly

Your preferred (canonical) URL
Enter the full URL including protocol (https://)
Force HTTPS
Replaces http:// with https:// in the canonical URL
Strip UTM parameters
Removes utm_source, utm_medium, utm_campaign, utm_content, utm_term
Strip session IDs
Removes sessionid, sid, PHPSESSID and similar session parameters
Strip ref / affiliate params
Removes ref, referrer, affiliate, aff_id, source parameters
Enforce trailing slash
Adds trailing slash to paths (be consistent with your site)
Lowercase path
Lowercases the URL path (not the domain) for consistency
URL normalisation applied
Enter a URL above and click “Generate canonical tag”.
ADSENSE — 728×90 LEADERBOARD
🌐
Implementing hreflang alongside canonical tags?
The free Hreflang Tag Generator creates HTML, XML sitemap, and HTTP header hreflang tags for multilingual and multi-regional sites — with live validation and x-default auto-fill.
🌐 Hreflang Generator →
⭐ Ratings

Rate this tool

4.9
★★★★★
Based on 9,400 ratings
5
8,554
4
564
3
188
2
94
1
0
Did this tool save you time?
Thank you for rating!
📖 How to Use

How to generate a canonical tag

1
Choose single or bulk
Single URL mode for one page with live validation and normalisation preview. Bulk mode lets you paste many URLs at once and get one canonical tag per URL.
2
Enter your preferred URL
Paste the URL of the page you want search engines to index — the canonical version. This is your “preferred URL”: the one you want to appear in search results.
3
Choose normalisation options
Enable Force HTTPS to upgrade http to https. Enable UTM parameter stripping to remove tracking parameters. Enable session ID or ref stripping for affiliate/tracking URLs.
4
Generate and review
Click Generate. See the normalisation preview showing exactly what changed in your URL, then review the generated canonical tag in the output area.
5
Choose output format
HTML tag (for the page head), HTTP Link header (for server config), WordPress PHP snippet, or Shopify Liquid. Each format is ready to paste directly.
6
Implement on every page version
Add the canonical tag to the head section of EVERY page version — www, non-www, http, https, parameter variants. All copies point to the same canonical URL.
✔ Key Features

Everything a canonical tag generator needs

📋
Bulk Mode
Paste hundreds of URLs at once — one per line — and get one canonical tag per URL. Instantly download all as a .txt file for developer handoff.
🧹
Parameter Stripping
Automatically remove UTM parameters, session IDs, ref/affiliate params. Shows a before/after normalisation preview so you see exactly what changed.
Live URL Validation
Flags relative URLs (missing protocol), HTTP instead of HTTPS, and other issues as you type. Green OK, amber warning, red error states in real time.
💻
4 Output Formats
HTML link tag for the head section, HTTP Link response header, WordPress PHP snippet with add_action hook, and Shopify Liquid template syntax.
💾
Download as .txt
Download the full output in any format as a named .txt file. Perfect for sharing with developers or keeping implementation records.
🔓
Free, No Account
100% free with no signup, no limits on URLs, and no premium tier. Generate canonical tags for any number of pages instantly.
🔧
Force HTTPS
Automatically upgrades http:// to https:// in the generated canonical. Never accidentally generate an HTTP canonical for an HTTPS site.
💡
Normalisation Preview
Shows a before/after comparison of your URL after applying all selected normalisation options. Confirms exactly what the canonical URL will be.
📱
Mobile Friendly
Fully responsive. Generate canonical tags from any device. The bulk textarea is scrollable and all buttons are thumb-friendly on mobile.
📊 Comparison

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 Tag Guide

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

ScenarioCanonical solutionExample
URL parameter duplicatesCanonical to clean URL/product?sort=price → /product/
UTM tracking linksStrip UTM, canonical to base/page?utm_source=email → /page/
HTTP vs HTTPSCanonical to HTTPS versionhttp://example.com → https://example.com
www vs non-wwwCanonical to preferred versionwww.example.com → example.com (or vice versa)
Trailing slash variantsCanonical to consistent form/page and /page/ → pick one
Paginated contentCanonical page 2+ to page 1/blog/page/2/ → /blog/
Syndicated contentCross-domain canonicalpartner-site.com → your original article
Every page (defensive)Self-referencing canonical/page/ → /page/ (same URL)

Canonical tag vs 301 redirect — which to use?

MethodUser experienceCrawlingBest use case
Canonical tagBoth URLs workBoth crawledURLs must remain accessible at all addresses
301 redirectOld URL redirects to newOld URL not crawled after redirectPage 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

MistakeImpactFix
Relative URL in canonicalIgnored by GoogleAlways use absolute URLs (https://example.com/page/)
Multiple canonical tagsBoth ignoredOne canonical per page only — check for plugin conflicts
Canonical points to redirected URLPassed as hintCanonical should point to the final destination URL
HTTP canonical on HTTPS siteMixed signalsAlways use HTTPS in canonical — use Force HTTPS option above
Canonical pointing to noindex pageConflicting signalsDon't noindex a page you've set as the canonical target
Canonicalling all pages to homepageMajor SEO errorCanonical should point to the most similar/relevant URL
❓ FAQ

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.