Canonical Tag Generator
Only lowercase the path if your server treats upper and lower case as the same page. Always point the canonical at a URL that returns 200 and is not blocked by robots.txt.
Canonical Tag Generator
The same page is often reachable at many addresses: with and without www, with a trailing slash or not, with ?utm_source= tracking or session parameters. A canonical tag tells search engines which address is the main one so ranking signals are not split. Paste a URL, choose your site's conventions, and get the clean canonical URL with the tag and HTTP header to use.
How to use Canonical Tag Generator
- Paste the page URL, including any parameters.
- Choose your conventions for HTTPS, www and trailing slashes.
- Choose how to treat query parameters: remove tracking only, keep only the ones you list, or keep all.
- Copy the canonical link tag into the page head, or use the HTTP header version for PDFs.
A worked example
The tool opens with this messy address: http://www.Example.com/Shoes/?utm_source=news&color=red&sessionid=123#reviews. With the default settings (use https://, remove tracking and session parameters) it gives:
- Canonical URL:
https://www.example.com/Shoes/?color=red - HTML tag:
<link rel="canonical" href="https://www.example.com/Shoes/?color=red" /> - HTTP header:
Link: <https://www.example.com/Shoes/?color=red>; rel="canonical"
The address switches to https, the host name is lowercased, utm_source and sessionid are removed, the #reviews fragment is dropped, and color=red stays because it changes what the page shows. Choose "Remove all except the ones below" to keep only the parameters you list, such as page.
The tracking parameters it removes are every utm_ tag, gclid, fbclid, msclkid, dclid, yclid, mc_cid, mc_eid, _ga, _gl, ref and referrer, plus the session IDs sessionid, sid, PHPSESSID and JSESSIONID.
Where to put the canonical tag
- HTML pages: one
<link rel="canonical">inside the<head>. Google ignores a canonical link placed in the body. - PDFs and other files: they have no head, so send the HTTP header version from the server.
- Full addresses: use the absolute URL with https:// and the domain, not a relative path.
- One per page: when a page declares two different canonicals, Google may ignore both.
Common mistakes
- Every page pointing at the homepage. A template that sets one canonical for the whole site asks Google to drop every other page. Each page should point at its own clean URL.
- A canonical that redirects or returns 404. Point it at the final address that returns 200. The Redirect Checker shows where a URL ends up.
- Canonical plus noindex. Noindex says "leave this page out", the canonical says "count this page as that one". Pick one. The Noindex Checker shows both signals.
- Sitemap and internal links that disagree. List only canonical URLs in your sitemap and link to them internally, or Google may choose another version.
To see which canonical a live page really has, run it through the On-Page SEO Checker. Campaign links built with the UTM Builder stay out of search results when the page carries a canonical to its clean address. Our guide to 301 vs 302 redirects explains when to redirect instead.
When it comes in handy
- Setting canonicals on pages reached through ads and campaigns.
- Cleaning URLs on filtered and sorted category pages.
- Fixing "duplicate without user-selected canonical" in Search Console.
Frequently asked questions
Should every page have a canonical tag?
Is a canonical a command?
What is the difference between a canonical tag and a 301 redirect?
Should the canonical URL end with a slash?
Related guides
-
301 vs 302 Redirects: Which One to Use, and How to Check Them
The difference between permanent and temporary redirects, how each affects SEO, common redirect mistakes, and how to set up and test them.
-
On-Page SEO Checklist: 15 Things to Check Before You Hit Publish
A practical, no-jargon checklist for getting a single page right: titles, descriptions, headings, images, links, indexing and structured data.
-
How to Check Any Page's SEO in 10 Seconds (and What Each Result Means)
Check a page's title, description, H1, canonical, noindex, robots.txt, alt text, schema, Open Graph and speed in seconds, and know which results matter.