BlogDada

Home / Tools / Canonical Tag Generator

Canonical Tag Generator

Paste a URL and get a clean, correctly formatted rel=canonical tag. Fixes HTTPS, www, trailing slashes and tracking parameters, one URL at a time or in bulk.

Canonical tag

      

    A free canonical tag generator for clean, correct URLs

    The same page on your site can usually be reached at several addresses. With and without www, with and without a trailing slash, over http and https, with tracking parameters from a newsletter, sorted and filtered versions of a category. To you they're one page. To a search engine they can look like half a dozen near-identical pages competing with each other.

    The canonical tag solves that. It's one line of HTML that names the version you want indexed, and it tells search engines to consolidate the ranking signals from all the duplicates onto it. This canonical tag generator writes that line for you and, just as importantly, cleans the URL first: forcing HTTPS, normalising www, fixing the trailing slash, stripping utm parameters and removing index.html.

    It works on a single URL or a whole list, outputs the HTML tag, an HTTP header or just the clean URL, and warns you about the mistakes that quietly break canonicals. It's free, needs no sign-up, and nothing you paste is uploaded.

    How to use the canonical tag generator

    1. Paste the preferred URLThis is the version you want search engines to show, not the duplicate you're tagging.
    2. Set your clean-up rulesForce HTTPS, decide on www and trailing slashes, and choose which query parameters to keep. Anything you list under "keep" survives; the rest are dropped.
    3. Check what changedThe before-and-after view shows exactly which parts of the URL were altered, so nothing happens silently.
    4. Copy the tagPaste it into the <head> of the page it describes and of every duplicate version.
    5. Doing a whole site?Switch to bulk mode, paste your list, and export the results as CSV.

    What is a canonical tag?

    A canonical tag is a link element in the head of a page that points to the preferred version of that page:

    <link rel="canonical" href="https://example.com/blog/my-post" />

    It was introduced in 2009 by Google, Bing and Yahoo together, and it's supported by every major search engine. When a crawler sees it, it treats the named URL as the one to index, and it passes the value of links pointing at the duplicates to that URL instead.

    Three rules matter. The URL must be absolute, including the protocol and domain. There must be exactly one canonical tag per page. And it must live in the <head>, not in the body, or it's ignored.

    Where duplicate URLs come from

    Almost nobody creates duplicates deliberately. They appear on their own:

    CauseExample
    Protocolhttp:// and https:// versions both resolving
    wwwexample.com and www.example.com
    Trailing slash/page and /page/
    Tracking parameters?utm_source=newsletter, ?fbclid=…, ?gclid=…
    Filters and sorting/shoes?sort=price&colour=black
    Session or referral IDs?sessionid=…, ?ref=homepage
    Index files/about/ and /about/index.html
    Multiple category pathsThe same product under two categories
    Printer and AMP versions/article?print=1
    Uppercase letters/Page and /page on a case-sensitive server

    Each of these splits your ranking signals across addresses that should be one page. A canonical tag puts them back together.

    Self-referencing canonicals

    A self-referencing canonical is a page pointing at itself. It sounds pointless and it isn't. When someone shares your link with a tracking parameter attached, or an aggregator republishes it with extra characters, the self-referencing tag on the page tells search engines which address is the real one.

    Google has said self-referencing canonicals aren't required, but recommends them as good practice, and most SEO plugins add them automatically. If you're not sure whether your site has them, view the source of any page and search for rel="canonical".

    Simple policy that works for most sites: every indexable page has a self-referencing canonical, and every duplicate, filtered or parameterised version points at the clean original.

    Canonical vs. 301 vs. noindex vs. hreflang

    These four tools all deal with duplication, and choosing the wrong one causes most canonical problems.

    ToolUse whenEffect
    Canonical tagBoth URLs must stay reachable by usersConsolidates signals; duplicate stays live
    301 redirectThe old URL should never be seen againUsers and crawlers are sent to the new URL
    noindexA page must exist but should not be in searchRemoved from the index; links still crawled
    hreflangSame content in several languages or regionsThe right version is shown to the right audience

    A quick test: if a visitor would be annoyed to land on the duplicate, redirect it. If the duplicate is genuinely useful, such as a filtered product list, keep it and canonicalise it.

    Common canonical mistakes

    • Canonicalising everything to the homepage. A classic misconfiguration. Google treats it as an error and usually ignores it, and you lose the chance to rank the individual pages.
    • Canonical plus noindex on the same page. Conflicting instructions. Choose one.
    • Relative URLs. href="/blog/post" works in some cases and fails in others. Always absolute.
    • More than one canonical tag. Often caused by a theme and an SEO plugin both adding one. Search engines may ignore both.
    • Canonical pointing at a redirected or 404 URL. The target must return a 200 status.
    • Canonicalising paginated pages to page one. Pages two and three have different content; use self-referencing canonicals instead.
    • The canonical in the body. It only counts inside the <head>.
    • Conflicting signals. If your sitemap, internal links and canonical disagree, Google picks for itself.
    • Canonicalising between genuinely different pages. The pages should be duplicates or very close variants, not two separate topics.

    How to add a canonical tag

    Plain HTML

    Paste the tag inside <head>, ideally near the top with the other meta tags.

    WordPress

    Yoast, Rank Math and All in One SEO all add self-referencing canonicals automatically, and each has a field for overriding the canonical per post or page (usually under "Advanced" in the SEO box). Don't add a second tag in the theme if a plugin is already outputting one.

    Shopify, Wix and Squarespace

    All three output canonicals for you. Shopify's product URLs under collections (/collections/x/products/y) canonicalise to the clean product URL by default, which is usually what you want. Custom overrides need a theme edit.

    HTTP header

    For non-HTML files such as PDFs, you can't add a link tag, so send the canonical as a header instead:

    Link: <https://example.com/guide.pdf>; rel="canonical"

    The generator produces this format too; choose "HTTP Link header" in the output options.

    Checking your canonicals

    • View source on any page and search for canonical. One tag, absolute URL, inside the head.
    • URL Inspection in Search Console shows both the canonical you declared and the one Google actually chose. When they differ, something else is outvoting your tag.
    • Crawl the site with a tool like Screaming Frog to find pages with missing, duplicated or self-conflicting canonicals at scale.
    • Check the target responds with 200. A canonical pointing at a redirect wastes the signal. Our website crawler checker shows the status and canonical of any page.

    Remember that the canonical is a hint, not a command. Google weighs it alongside internal links, sitemap entries, redirects and hreflang. The more of those that agree, the more likely your chosen URL wins.

    Cross-domain canonicals

    A canonical can point to a different domain, and that's the standard way to handle syndication. If you publish an article on your site and a partner republishes it, the partner's copy should carry a canonical pointing back to your original. That way your version accumulates the ranking signals rather than competing with a copy on a bigger site.

    Two practical notes. The partner has to actually implement it, so agree it in writing before the article goes out. And if they won't, ask for a plain link back to the original instead, which is worth less but still helps.

    Canonicals for e-commerce and faceted navigation

    Online shops generate more duplicate URLs than any other kind of site, because every filter, sort order and pagination step creates a new address. A category with five filters can produce thousands of combinations, all showing slices of the same products.

    The usual approach is to canonicalise filtered and sorted versions back to the clean category URL, since those pages rarely deserve to rank on their own. A shopper filtering by colour is already on your site; they do not need to arrive from search on that exact combination. Where a filtered page does have real search demand, such as "black running shoes", treat it as a proper landing page with its own content and a self-referencing canonical instead.

    Pagination is different. Page two of a category is not a duplicate of page one, it lists different products, so each page should point at itself. Google retired its support for rel=next and rel=prev years ago, and the current advice is simply to let paginated pages be indexable with self-referencing canonicals and clear links between them.

    Product variants need a decision. If colour and size options load on one page without changing the URL, there is nothing to do. If each variant has its own URL, pick the main product URL as canonical unless the variants have distinct search demand and their own descriptions.

    A sensible canonical policy

    Most canonical problems come from inconsistency rather than ignorance, so write the rules down once and apply them everywhere:

    • Pick one format and stick to it: https, one choice on www, one choice on trailing slashes, lowercase URLs.
    • Enforce it with redirects, so the wrong versions never load, and use canonicals for what redirects cannot fix.
    • Self-reference every indexable page.
    • Make your sitemap agree with your canonicals, listing only canonical URLs.
    • Link internally to canonical URLs only, because internal links are one of the strongest signals Google weighs.
    • Re-check after every migration, theme change or plugin update, which is when canonicals quietly break.

    Frequently asked questions

    What is a canonical tag?

    A canonical tag is a line of HTML that tells search engines which version of a page is the main one. It looks like a link element with rel=canonical and an absolute URL, and it goes in the head of the page.

    Is this canonical tag generator free?

    Yes. It is free, needs no sign-up, and runs entirely in your browser, so the URLs you paste are never uploaded.

    Should every page have a canonical tag?

    Most SEOs add a self-referencing canonical to every indexable page. It costs nothing and protects you when URLs pick up tracking parameters or get shared with extra characters.

    Does Google always follow the canonical tag?

    No. Google treats it as a strong hint rather than a directive. If other signals such as internal links, sitemaps or redirects point elsewhere, Google may pick a different canonical.

    Canonical tag or 301 redirect?

    Use a 301 redirect when users should never see the duplicate. Use a canonical when both versions need to stay reachable, such as a product listed in two categories or a page with filter parameters.

    Can a canonical point to a different domain?

    Yes. Cross-domain canonicals are supported and are the usual way to handle syndicated articles republished on another site.

    Should I use canonical and noindex together?

    No. They send conflicting signals: one says consolidate this page with another, the other says drop it entirely. Pick one.

    Do canonical URLs have to be absolute?

    Yes, always include the protocol and domain. Relative canonical URLs are a common source of errors, and this tool always outputs absolute URLs.

    Generate your canonical tag

    One clean line of HTML keeps your ranking signals in one place instead of spread across five addresses. Go back to the canonical tag generator, paste your URL and copy the tag.

    More free tools from BlogDada