How to use canonical URLs for your website

Canonical URLs help a website tell search engines which address should represent a page when the same or very similar content can be reached through multiple URLs. The most common duplicates come from HTTP and HTTPS variants, www and non-www hosts, tracking parameters, filtered category views, print pages, and older paths that still resolve after a redesign.

For a webmaster, canonical work is about aligning every signal around the preferred URL rather than treating the tag as a standalone fix. Redirects, internal links, sitemap entries, and page-level canonical tags should all reinforce the same public address, because search engines can ignore a weak canonical hint when the rest of the site points somewhere else.

The practical workflow needs access to the site's templates or CMS settings, a public page that can be inspected in a browser, and a verified Google Search Console property. Current Google guidance recommends a single absolute canonical URL in the HTML head, and the indexed result in URL Inspection is the place that shows both the User-declared canonical and the Google-selected canonical when duplicates are evaluated.

Steps to use canonical URLs for a website:

  1. Choose the exact public URL pattern that should represent each indexable page and keep the protocol, hostname, trailing-slash style, and parameter handling consistent across the site.

    Common duplicate cases include HTTP and HTTPS versions of the same page, www and non-www hosts, tracking-parameter URLs, filtered listings, and legacy paths left live after structural changes.

  2. Redirect every non-preferred duplicate that can safely disappear to the preferred URL so the canonical signal is backed by a permanent site rule instead of only a page tag.

    Use canonical tags for near-duplicate URLs that still need to exist, such as campaign-parameter URLs or filtered views, and use redirects when the old URL should stop being served as a separate public page.

  3. Add one rel="canonical" link element in the HTML head of the preferred page and each duplicate or parameter variant, pointing to the same preferred absolute URL.
    <link rel="canonical" href="https://www.example.com/guides/canonical-url" />

    Google recommends absolute URLs and only accepts the canonical link element in the HTML head, so do not place it in the body, duplicate it, or point it at a fragment URL.

  4. Keep internal links, breadcrumbs, navigation, structured data references, and XML sitemap entries pointing to the canonical URL rather than to duplicate variants.

    A sitemap should list the canonical public URL for each page, not redirected, blocked, or parameter versions of the same content.

  5. Point canonical tags only at pages that return 200 OK, stay indexable, and remain substantially equivalent to the page carrying the tag.

    Canonicalizing a product page to the homepage, a filtered page to an unrelated category, or an older URL to a redirect target that changes again can cause search engines to ignore the signal and keep a different URL.

    Robots.txt controls crawling, not canonical selection, and noindex removes a page from Search instead of merging it into another URL.

  6. Open a representative page in a browser and view the page source to confirm that a single canonical tag appears in the HTML head with the exact preferred URL.

    Check the raw HTML source rather than only the rendered DOM when a plugin or JavaScript layer might inject or rewrite metadata late in the page load.

  7. Inspect the same URL in Google Search Console and compare the User-declared canonical and Google-selected canonical fields in the indexed result.

    Use Test live URL to confirm the current page is reachable, but rely on the indexed result when checking canonical selection because the live test does not evaluate duplicate or alternate-page status.

  8. Fix every conflicting signal and recheck the page until redirects, canonical tag, internal links, sitemap entries, and Search Console all agree on the same preferred URL.

    A canonical tag is a hint rather than a hard rule, so mixed signals can still make Google pick a different URL as canonical.