Paste a URL and this canonical tag generator builds a clean, absolute tag you can paste into your page head. It forces HTTPS, strips tracking parameters, removes hash fragments, and checks the result against Google’s own rules.
Cleanup options
Your canonical tag
Preview inside a page head
What changed
Validation checks
Your URLs are processed in your browser and never sent to a server. This tool cannot check whether a canonical target returns a live page, so open the target in your browser before you ship the tag. A canonical is a hint to search engines, not a guarantee, so keep your sitemap and internal links pointed at the same preferred URL.
How to Use This Canonical Tag Generator
Paste a messy URL and this canonical tag generator turns it into a clean tag you can paste into your page head. It forces HTTPS, strips tracking parameters, removes hash fragments, and checks the result against Google's own rules, so you stop guessing about slashes, www, and case. The tool runs in your browser at AI Holic, and nothing you type is sent to a server. Use it for one page or for a list of fifty, and copy the HTML tag or the HTTP Link header for PDFs and other files that have no head section.
Paste the page address into the first field. If the page should point at a different address, paste that address into the second field. Leave the second field empty when the page should point at itself, which is the usual case. Pick your cleanup options, then read the tag, the Link header, the list of changes, and the checks. Copy the HTML tag into the head, or copy the Link header for a PDF. Bulk mode works the same way for up to fifty addresses at once, and it gives you a table, a copy-all button, and a CSV download.
What Is a Canonical Tag
A canonical tag is a link element in the page head that names the preferred address for a page when the same content lives at more than one address. Search engines use it to fold duplicate signals onto one URL, so your ranking strength stops splitting across copies. The tag looks like this: . The address inside the tag is called the canonical URL, and the page that carries the tag is the duplicate or the variant.
Google treats the tag as a strong hint, not a command. It weighs the tag with internal links, sitemaps, redirects, and HTTPS, and it may still pick a different canonical. If you set no tag at all, Google picks the version it judges best. That is why the tag works best when every signal agrees. Google's own guide to canonical URLs lists redirects as the strongest signal, the link tag next, and sitemap inclusion as the weakest, and it says the methods stack when you use more than one.
A canonical is not a redirect, and it is not a way to remove a page from search. Visitors still reach every address, and a duplicate stays indexed unless you add noindex. Use a canonical when both addresses must stay live but one should win. Use a 301 when a page has truly moved, and use noindex when a page should leave search entirely.
Worked Example: From a Messy URL to a Clean Canonical
Take this address, copied from a newsletter link: . It has four problems. The protocol is http, the host uses a capital letter, two tracking parameters ride along, and a hash fragment sits at the end. Paste it into this canonical tag generator with the default options, and the tool applies four changes.
- Lowercased the host name.
- Upgraded http to https.
- Removed tracking parameters: utm_source, utm_medium.
- Removed the hash fragment.
The result is this clean address: . The tag for that address is ready to copy, and the checks panel confirms it is absolute, secure, and free of tracking noise. The trailing slash stays as typed, because the default policy is Keep as typed. Note that the path keeps its capital letters, because Lowercase path stays off by default. Paths can be case-sensitive on some servers, so the tool never changes path case unless you ask it to.
The same cleanup habit helps anywhere you paste an address by hand. If you also need a fresh unique id for a test page, our UUID generator builds one in a click.
Canonical Tag vs 301 Redirect vs Noindex
These three tools look similar, but they do different jobs. Pick the one that matches your goal.
| Method | What it does | Use it when |
|---|---|---|
| Canonical tag | Suggests a preferred address while every address stays live | Duplicates or variants must stay live |
| 301 redirect | Moves visitors and crawlers to a new address | A page has truly moved |
| Noindex | Keeps a page out of search results | A page should not appear in search at all |
Pick the method that matches your goal. A canonical will not move visitors, a redirect will not keep a duplicate live, and noindex will not pass signals to another page. Mixing them up is how pages vanish from search by accident.
The Cleanup Rules This Tool Applies
Every rule below is a switch you control. The defaults match Google's guidance, and every change is listed under What changed, so you can see why two addresses collapse to one.
| Rule | What it does | Why it matters |
|---|---|---|
| Force HTTPS | Upgrades http to https | Google prefers the secure version as canonical |
| Strip tracking parameters | Removes utm tags, gclid, fbclid, and 20 more | Campaign noise must not sit in a canonical |
| Strip hash fragment | Removes the part after the hash | Fragments are never sent to servers |
| Lowercase host | Lowercases the host name | Host names are case-insensitive |
| Lowercase path | Lowercases the path when you turn it on | Paths can be case-sensitive, so this stays off by default |
| Strip www | Removes www from the host when you turn it on | Pick one host form and keep it everywhere |
| Trailing slash policy | Keeps, adds, or removes the final slash | Google treats slash and no-slash as different addresses |
One rule deserves a warning. A URL whose query string holds a real value, such as a search term, keeps that value, and the copied tag escapes it correctly for HTML. The tool tells you when it does that, so you know the tag is safe to paste.
Common Canonical Tag Mistakes
Most canonical failures are small hygiene problems. The four cases below come from real tools and real audits, and each one has a fix you can apply in seconds.
| Mistake | Example | Fix |
|---|---|---|
| Relative path | | Use the full absolute address with https and the host |
| HTTP plus tracking params | | Force HTTPS and strip utm tags before you copy |
| Homepage dump | | Point each unique page at itself, not at the homepage |
| Correct form | | Absolute, secure, clean, and self-referencing |
Two more mistakes never show up in a tag. The first is a tag placed in the body instead of the head, which Google ignores. The second is a tag that points at an address which redirects, returns a 404, or carries noindex. This tool cannot check whether a target returns a live page, so open the target in your browser before you ship.
How to Add a Canonical Tag on Your Platform
WordPress with Rank Math: open the post, find the Rank Math box, open the Advanced tab, and paste the address into the Canonical URL field. Save the post and check the live page with view source.
WordPress with Yoast SEO: open the post, open the Yoast sidebar, open the Advanced section, and paste the address into the Canonical URL field. Save and check the live page.
Shopify: Shopify writes canonicals for products and collections on its own. To change one, edit theme.liquid, find the head section, and paste the tag there. Save the theme and check a live product page.
Next.js: use the next-seo package or set the canonical in your page metadata. Build the tag from the page slug at build time, so every page ships with a correct tag before it reaches production.
Webflow: open the page settings, open SEO settings, and paste the tag into the Custom Code box in the head section. Publish the site and check the live page.
Static HTML: open the file, find the head section, and paste the tag right after the meta description. Save the file, upload it, and check the live page with view source.
When to Use a Cross-Domain Canonical
Cross-domain canonicals fit one case: a copy of your work lives on another site. A partner republishes your article, or you syndicate a post to a large platform, and the copy should point back at your original. That sends the ranking signals home instead of splitting them. The copy carries the tag, and your original carries a self-referencing tag. It must not point back, or the signal loops. Both pages need real content that search engines can crawl, or the hint is ignored. Never use a cross-domain canonical to claim a page you did not write, and never point unrelated pages at one address to merge their strength. That is not how the tag works.
Publisher Checklist Before You Ship
Run this canonical tag generator once more after you paste the tag, then walk this list before you call the page done.
- Is the canonical address absolute and HTTPS?
- Did you strip utm tags and other tracking parameters?
- Does the address match your trailing slash and www policy?
- Is there only one canonical signal on the page?
- Is the tag in the head, or the Link header set for a PDF?
- Do your internal links and sitemap use the same preferred address?
- Are you avoiding chains, where one canonical points at another?
- Did you open the target address and confirm it loads cleanly?
Frequently Asked Questions
What is a canonical tag generator?
A canonical tag generator is a small tool that turns a page address into a correct link tag for the page head. You paste the preferred URL, and it returns the tag with the right format, an absolute HTTPS address, and no tracking noise. It saves you from typing the tag by hand and from the small typos that break it. This page also checks the result and gives you the HTTP Link header form for files like PDFs.
Should every page have a self-referencing canonical tag?
Yes, for most indexable pages. A self-referencing tag points a page at its own address, which is what Google recommends in its own guide. It costs nothing, and it protects the page when tracking parameters, case changes, or scraper copies create extra versions of the same address. The only pages that should skip it are pages you mean to keep out of search, and those need noindex instead.
Is a canonical tag a rule Google must follow?
No. Google treats a canonical tag as a strong hint, not a command. Google weighs it with other signals, such as internal links, sitemaps, redirects, and HTTPS, and it may still pick a different canonical. If you do not set one at all, Google picks the version it judges best. That is why the tag works best when every signal points at the same preferred URL.
Why use a canonical tag generator instead of writing the tag by hand?
Hand-written tags fail on small details. A missing letter in the host, a leftover tracking parameter, or a trailing slash that does not match your site can all weaken the signal. A generator applies the same cleanup rules every time, checks the result, and shows you exactly what changed. It also builds the HTTP Link header form, which is easy to get wrong by hand.
Should tracking parameters stay in a canonical URL?
No. Tracking parameters belong on campaign links, not on canonical URLs. A canonical should name the clean preferred address, so strip utm tags, gclid, fbclid, and similar noise before you generate the tag. Keep only parameters that truly change the page content, such as a product id that picks a different item. When in doubt, strip the parameter and test the page without it.
Can a canonical tag point to another domain?
Yes. A cross-domain canonical points a republished copy back at the original on a different host. News sites and blogs use it when a partner republishes their work, so the ranking signals flow back to the source. The copy points at the original, and the original must not point back. Both pages need real content that search engines can crawl, or the hint will be ignored.
Where do I put the canonical tag on my page?
Put one tag in the head section of the page, near the top, after the character set declaration. Google ignores a canonical that sits in the body, so placement matters as much as the address. If the file has no head section, such as a PDF, send the Link header from your server instead. Check the live page with view source to confirm the tag is really there.
Why did Google pick a different canonical than the one I set?
Google picks a canonical from many signals, and your tag is only one of them. If your sitemap lists a different URL, your internal links point elsewhere, or the page redirects, Google may trust those signals more. Open the URL in Search Console and read the inspection report to see which signal won. Then line up the sitemap, the links, and the tag on the same preferred URL.
Conclusion
Paste your messiest URL into this canonical tag generator, read the checks, and copy a tag you can trust. Keep the sitemap, the internal links, and the tag pointed at the same preferred address, and confirm the target page loads cleanly before you ship. That is all a good canonical setup needs.
More from AI Holic: start at the AI Holic homepage, check how easy your pages are to read with our readability checker, and score a sample passage with our Flesch Kincaid calculator.
