Add to Chrome Add to Edge

Canonical Tag Generator

Clean up a URL and generate its canonical tag, removing tracking parameters and fixing www, HTTPS and slashes.

Canonical Tag Generator

Canonical URL

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

  1. Paste the page URL, including any parameters.
  2. Choose your conventions for HTTPS, www and trailing slashes.
  3. Choose how to treat query parameters: remove tracking only, keep only the ones you list, or keep all.
  4. 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?
Yes, a self-referencing canonical on each indexable page is good practice. It protects against copies created by parameters and tracking links.
Is a canonical a command?
It is a strong hint. Google may choose a different canonical if other signals, such as internal links, redirects and the sitemap, point elsewhere, so keep them consistent.
What is the difference between a canonical tag and a 301 redirect?
A 301 sends visitors and search engines to the other URL. A canonical leaves the page reachable and only tells search engines which version to show in results. Redirect when the old address should no longer be used; use a canonical when both versions have to stay, such as filtered or tagged URLs.
Should the canonical URL end with a slash?
Use whichever form your site really serves with a 200 status, and use it everywhere. The trailing slash option adds or removes it so the tag matches your convention.

Related guides

More on the SEO & Web Tools board

52 tools, each doing one job. Pick the next one.

Other boards

Choose which cookies SEOpeck may use. You can change this at any time from "Cookie settings" at the bottom of every page.

Your tools

    Saved in this browser only. Nothing is sent to us.

    Popular tools