Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    What Is a Canonical Tag and How Do You Write One?

    Updated November 2026

    Written by the Toolpuffin team. Tools in this guide are tested in the browser.

    The same page can often be reached at several addresses: with and without www, with tracking parameters or with a trailing slash. A canonical tag tells search engines which address is the main one. This guide explains when you need it and how to write it.

    Try the tool: Canonical Tag Generator

    What a canonical tag is

    A canonical tag is a link element in the head of a page. It names the address that you want search engines to treat as the main version when the same or very similar content exists at more than one address.

    Example: <link rel="canonical" href="https://example.com/shoes/" />

    Search engines treat it as a strong hint, not as a command. They may still pick another address if other signals point that way.

    Source: Google Search Central: consolidate duplicate URLs

    When you need one

    • The same page opens with and without www, or with http and https.
    • Links carry tracking parameters such as utm_source, fbclid or gclid.
    • A page can be reached with and without a trailing slash.
    • The same product shows up in several categories with different addresses.

    How to write it correctly

    • Use a full address with https, not a relative path.
    • Put one canonical tag in the head of the page, not several.
    • Point to a page that works and is not redirected.
    • Let a normal page point to itself with its own clean address. That is common and safe.
    • Only point to another page when that page really is the main version.

    Build one with the tool

    1. Paste the address of the page.
    2. Choose https, with or without www and the trailing slash. Tracking parameters and the #fragment are removed.
    3. Copy the canonical tag into the head of the page.

    What the tool does not do

    It cleans and formats the address you type and does not open the page. Check yourself that the address works. A canonical tag also does not remove a page from search results and does not replace a redirect when an old address should no longer be used.

    More guides