Canonical Tag Generator

Paste the URL your page should canonicalize to and get a clean, copy-paste link tag. The linter below flags the mistakes that quietly break canonicals: relative paths, stray parameters, fragments, and mixed case.

Use the full absolute URL, including https:// and the host.

Lets the linter check the relationship between the page and its canonical.

     

    What the linter checks

    Most canonical problems are not exotic. They are the same five mistakes repeated across millions of sites: a relative path where an absolute URL is required, an http canonical on an https site, tracking parameters baked into the target, a fragment that Google strips anyway, and case mismatches between the canonical and the live URL. This tool runs each of those checks as you type and offers a one-click fix where a safe fix exists.

    Where to place the tag

    The link element belongs in the <head> of the page, before any element that closes the head early, such as an unescaped script. One canonical per page. If your CMS or theme also injects one, remove the duplicate, because conflicting canonicals usually get both ignored. For non-HTML files such as PDFs, send the same signal with an HTTP header: Link: <URL>; rel="canonical".

    Consistency beats the tag

    Google weighs the canonical alongside your other signals: internal links, the XML sitemap, redirects, and hreflang. Pick one form of every URL, lowercase, https, one trailing-slash convention, and use it everywhere. When all signals agree, the canonical hint is honored almost without exception.

    Frequently asked questions

    Should every page have a self-referencing canonical?

    Yes. A self-referencing canonical tells Google which version of the URL you consider primary, which protects you when the page gets linked with tracking parameters, session IDs, or mixed-case paths. It costs nothing and removes ambiguity, so make it part of your default template.

    What is the difference between a canonical tag and a 301 redirect?

    A 301 redirect is a directive: visitors and crawlers are physically moved to the target URL. A canonical tag is a signal: both URLs stay accessible and you are asking Google to consolidate indexing onto one of them. Use a 301 when the duplicate should not exist at all, and a canonical when both versions need to stay live, for example printer pages or filtered listings.

    Can Google ignore my canonical tag?

    Yes. The canonical is a hint, not a command. If your internal links, sitemap, and redirects all point at a different URL, or the two pages have very different content, Google may pick its own canonical. Keep every signal consistent and the hint is almost always honored.

    Are cross-domain canonicals allowed?

    Yes, Google supports canonicals that point to a different domain. They are the standard way to handle syndicated content: the republisher canonicalizes to the original article so ranking signals consolidate there. Just make sure it is deliberate, because a cross-domain canonical hands your indexing to the other site.