Canonical URL Generator
Generate a canonical link tag from any URL.
Was this tool helpful?
Thanks for the feedback!
Canonical URL Generator turns a messy page address, full of tracking parameters, filters or fragments, into a clean <link rel="canonical"> tag. The tag tells search engines which version of a page you prefer, so duplicates created by campaign links, sorting options or session IDs don't compete with the main page.
How the address is cleaned
Paste a full URL, including http:// or https://, and press Generate. The tool:
- lowercases the domain name,
- removes everything after
?, including UTM tags and all other parameters, - removes any
#fragment, - removes a trailing slash from the path,
- and keeps the path's capitalisation exactly as it was.
For example, https://Example.com/Shoes/Running/?utm_source=insta&color=red#reviews becomes:
<link rel="canonical" href="https://example.com/Shoes/Running">
Addresses without a scheme, such as example.com/page, are rejected as invalid.
Check the result against your real URLs
The clean-up follows fixed rules, so review the tag before using it:
- Parameters that define the page. On sites where the content depends on a parameter, like
product.php?id=42, the tool returnsproduct.php. Using that tag would point every product at one address. Add the parameter back in such cases. - Trailing slashes. Many sites, including WordPress by default, use addresses ending in
/and redirect the version without it. If yours does, add the slash back so the canonical points to the URL that actually loads, not to one that redirects. - Protocol and www. The tool keeps
httpandwwwexactly as entered. Make sure the tag uses the version your site redirects to, normallyhttps.
Where the tag goes and how Google treats it
Place the tag in the <head> of the duplicate pages and, as a self-referencing canonical, on the preferred page itself. Use one canonical tag per page with an absolute URL, as Google recommends. SEO plugins like Yoast and Rank Math output a canonical automatically, so check the page source first to avoid ending up with two conflicting tags.
A canonical is a hint, not a command. Google weighs it together with redirects, internal links and sitemaps, and may select a different URL if the signals disagree. Search Console's URL Inspection report shows both the canonical you declared and the one Google chose.
Canonical, redirect or noindex?
- Use a canonical when both versions must keep working for visitors, such as a product reachable through several filtered or tracked URLs.
- Use a 301 redirect when the old address shouldn't be used at all; the 301 Redirect Generator writes the rule.
- Use noindex for pages that shouldn't appear in search results at all, such as internal search results.
Paginated pages (page 2, page 3 of a category) should each have their own self-referencing canonical rather than all pointing to page 1. Keep campaign tags from the UTM Link Builder out of the canonical, which is exactly what this tool strips.