Free tool
Canonical tag generator
This canonical tag generator turns any URL into a clean rel=canonical tag. It strips tracking parameters, fragments and index.html, switches to https, and shows what it changed and why, for one page or a whole list.
Canonical URL
https://example.com/shoes/Red-Trainers/?color=red
What changed
Step by step
How to use the canonical tag generator
- Paste the page URL. Copy it straight from the browser, parameters and all.
- Add a preferred URL only for duplicates. Leave it empty and the page points to itself, which is what most pages need.
- Check the clean-up rules. The defaults suit most sites. Set www and the trailing slash to match how your site links to its own pages.
- Read what changed. Every change comes with the reason, and anything worth a second look is flagged.
- Copy the format you need. The HTML tag for the page head, the HTTP header for PDFs, or the plain URL for Yoast, Rank Math or Shopify.
The basics
What a canonical tag does
The same page is often reachable at several addresses: with and without www, over http and https, with tracking parameters from an email or an ad, or with sorting options in the URL. A canonical tag tells search engines which of those addresses is the real one.
<link rel=”canonical” href=”https://example.com/shoes/red-trainers/” />
Google treats it as a strong signal rather than a command. Redirects are equally strong, and listing a URL in your sitemap is a weaker hint. If your signals disagree with each other, Google may pick a different URL from the one you named, so keep them consistent.
Choosing the target
Self-referencing or pointing elsewhere
Point a page at itself when it is the version you want in search. That covers most pages, and it means a link with tracking parameters still consolidates to the clean URL.
Point a page at another URL when it is a genuine duplicate:
- Tracking, sorting or filtered versions of the same list.
- A product that appears under several categories, each with its own URL.
- Printer-friendly or AMP copies.
- An article republished on another site, pointing back to the original.
Do not point page two of a list at page one, point pages with different content at each other, or pair a canonical with noindex on the same page. Those send Google conflicting instructions.
The rules
Canonical tag rules Google publishes
- Use absolute URLs, including https://. Relative paths work but cause problems over time.
- The tag only counts inside the head of the page.
- Name one canonical per page, and do not contradict it with a different canonical in your sitemap or headers.
- Do not use a URL fragment such as #reviews as the canonical.
- Do not use robots.txt or noindex to handle duplicates.
- Google prefers the https version of a page as canonical.
- A canonical can point to another domain when the content is the same.
These come from Google’s guide to consolidating duplicate URLs, last updated in July 2026.
Clean-up
Tracking parameters this tool removes
Every utm_ parameter, plus the click and campaign identifiers added by ad and email platforms: gclid, gbraid, wbraid, dclid, fbclid, msclkid, yclid, ttclid, twclid, li_fat_id, igshid, mc_cid, mc_eid, _ga, _gl, _hsenc, _hsmi, mkt_tok and srsltid. Add your own, such as a session or sort parameter, in the clean-up rules.
Parameters that change the content, such as a colour or a page number, are kept and flagged so you can decide.
Bulk
Canonical URL generator for many pages
Switch to Many pages and paste a list, one URL per line. Each one gets a cleaned, self-referencing canonical. To point a duplicate at another page, put both URLs on the same line, the duplicate first. The URL only format downloads as a two-column file, ready for a spreadsheet or a plugin import.
If you are setting up hreflang at the same time, the hreflang tag generator uses the same approach for language versions. Each language version should carry a canonical that points to itself.
FAQ
Questions about canonical tags
What is a canonical tag?
It is a line in the head of a page that names the main version of that page. When the same content can be reached at several URLs, it tells search engines which one to show in results.
Where do I put the canonical tag?
Inside the head section of the page. Google ignores canonical tags anywhere else. For PDFs and other files without a head, send it as an HTTP header. In WordPress, Yoast and Rank Math both have a canonical URL field you can paste the URL into.
Should every page have a self-referencing canonical?
Yes, for pages you want indexed. Google recommends putting a canonical tag on the canonical page itself, which also protects the page when someone links to it with tracking parameters added.
Is a canonical tag the same as a 301 redirect?
No. A redirect sends visitors and search engines to the other URL. A canonical tag leaves visitors where they are and only tells search engines which version to index. Google treats both as strong signals.
Can a canonical tag point to another domain?
Yes. Google supports cross-domain canonicals, for example on an article republished on another site. Only use one when the content really is the same.
Is this canonical tag generator free?
Yes. It runs in your browser, there is no sign-up, and the URLs you enter stay on your device.
Duplicate pages showing up in search?
Book a 30 minute call. I will look at which URLs Google is choosing for your pages and why they differ from the ones you intended.