All tools

Canonical URL Builder & Checker

Normalize messy URLs, strip tracking parameters, and generate clean rel="canonical" tags locally in your browser.

Normalization options

WWW preference

Trailing slash

Match your site's actual canonical pattern for consistency.

Extra parameters to strip

Parameters to always preserve

Parameters that change content (e.g. page, id, lang) — these override the strip list.

All URL normalization runs locally in your browser. No URLs are uploaded or stored.

Canonical URL

Canonical URL will appear here…

All URL normalization, parameter stripping, and canonical tag generation happen entirely in your browser. No URLs or query strings are sent to CodeAva servers. The tool is safe to use with internal staging URLs, draft content paths, and URLs containing sensitive campaign parameters.

What a canonical URL is and why it matters

A canonical URL is the preferred version of a page among several URLs that serve the same or very similar content. You declare it using a <link rel="canonical" href="..." /> tag in the HTML head of each duplicate or near-duplicate page. The canonical tag tells search engines which version you consider authoritative and want indexed. It is a recommendation rather than an absolute directive — search engines may or may not follow it depending on the consistency of your other signals.

Websites produce multiple URL variants of the same page far more easily than most teams realize. Tracking parameters from campaign links create hundreds of query-string variants. HTTP and HTTPS versions co-exist on sites with incomplete redirects. WWW and non-WWW hostnames both resolve. Trailing slashes cause split-path duplicates. Crawl-appended session IDs or sort/filter parameters generate additional variations. Each of these is technically a different URL, and without consistent canonical signals, a search engine has to guess which version to prefer and how to consolidate their signals.

Consistent canonical signals and clean URL patterns help search engines choose the preferred version more reliably, consolidate ranking signals that would otherwise be split across variants, and prevent internal competition for the same search intent. They also make analytics more accurate by reducing session fragmentation caused by tracking-parameter URL variations.

What is a canonical URL and why is it important for SEO?

A canonical URL identifies the representative version of a page when multiple URL variants could serve the same content. Setting a consistent canonical helps search engines understand which URL to index, which to use in search results, and where to consolidate link signals. Without clear canonical signals, search engines must make their own best guess — which may not match your intent.

The rel="canonical" tag is a strong hint, not a hard instruction. Google and other search engines treat it as a recommendation they are free to override if other signals (such as a redirect or sitemap entry) contradict it, or if the declared canonical differs significantly from the page's actual content. For cases where a page truly should never be accessible at the non-canonical URL, a 301 redirect is a stronger canonicalization signal.

Duplicate content traps cheat sheet

These are the most common sources of unintentional URL duplication. Each generates a distinct URL that can compete with the canonical version if not managed explicitly.

IssueConfusing URL variantClean canonical candidate
Tracking parameters/page?utm_source=fb&fbclid=abc/page
Protocol variationhttp://example.com/pagehttps://example.com/page
WWW / non-WWWwww.example.com/page and example.com/pagePick one consistently — https://example.com/page
Trailing slash mismatch/page/ vs /pagePick one and apply consistently — redirect the other
Session ID/page?PHPSESSID=abc123/page
Fragment / hash noise/page#section-2/page — fragments are not sent to the server

Setting canonical URLs in HTML and Next.js

In plain HTML, add the canonical link tag inside the <head> of every page, including the canonical page itself (self-referencing canonical):

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

In Next.js App Router, declare the canonical using the alternates.canonical metadata field:

// app/my-page/page.tsx
export const metadata = {
  title: "My Page",
  alternates: {
    canonical: "https://example.com/my-page",
  },
};

For pages that should truly never be accessible at their non-canonical URL, a 301 redirect is a more reliable canonicalization signal than a rel="canonical" tag. Use both where possible: redirect non-canonical URLs to the preferred version and add a self-referencing canonical on the destination.

What this tool helps with

Good uses

  • Removing tracking parameters from shared or scraped URLsstrip UTM, fbclid, gclid, msclkid, and other campaign parameters before using a URL as the canonical reference or adding it to a sitemap.
  • Standardizing HTTPS across crawled URL listsforce-upgrade all http:// URLs in a Screaming Frog or Ahrefs export to https:// in one bulk pass.
  • Normalizing www/non-www preference before canonical deploymentchoose a consistent host preference and apply it to a list of URL variants before generating canonical tags for a site migration or audit.
  • Trailing slash normalization for router and CMS consistencyenforce a consistent trailing-slash policy across all URL variants to prevent split-signal duplication.
  • Cleaning URL lists from crawler exports for canonical tag generationpaste a full crawl URL list into Bulk mode, apply your site's normalization preferences, and export clean canonical candidates ready to import into a CMS or static site generator.
  • Exporting canonical link tags for CMS or framework templatescopy the exact rel="canonical" HTML tag output for use in WordPress head hooks, Contentful rich text, Next.js metadata, or any framework that accepts raw head tag markup.

Limitations to know

  • Live crawling or remote canonical auditingthis tool builds and normalizes canonical candidates from pasted input. It does not fetch live pages, check server responses, or verify that a declared canonical matches a real page's content.
  • Blindly stripping all query parametersparameters like page, id, lang, or product may be part of the canonical URL for paginated content, product variants, or localized pages. Use the preserve-param list to protect parameters that genuinely distinguish content.
  • Treating canonical tags as a substitute for redirectscanonical tags are a hint. If a non-canonical URL should not be directly accessible, implement a 301 redirect in addition to the canonical tag.

How to generate and deploy canonical tags

  1. 1

    Paste a messy URL or switch to Bulk mode

    In Builder & Checker mode, paste a single URL — including tracking parameters, fragments, or inconsistent protocol and host. In Bulk mode, paste a column of URLs from a crawler export or spreadsheet, one per line.

  2. 2

    Configure normalization options

    Set your HTTPS preference, WWW mode, trailing slash rule, path lowercasing, fragment stripping, and parameter stripping. Add custom parameters to strip or preserve using the param-management panels.

  3. 3

    Review the canonical output and change log

    Each applied change is listed in green. Amber warnings highlight remaining parameters, fragments, or ambiguous choices that need a judgment call before deploying. Invalid URLs are flagged in red.

  4. 4

    Copy the canonical URL or link tag

    Copy the clean URL or the full rel="canonical" tag. The tag is ready to paste into your HTML head, CMS custom code area, or framework metadata configuration.

  5. 5

    Export bulk results and use in your workflow

    From Bulk mode, copy all canonicals, copy as CSV with both original and cleaned columns, or download as .txt or .csv. Import back into your spreadsheet, CMS importer, or redirect configuration.

Common issues and how to fix them

Tracking parameters appearing in indexed canonical URLs

Share URLs often carry UTM or click-tracking parameters that should not appear in the canonical. Use this tool to strip them before setting the canonical tag. Enable 'Strip known tracking parameters' — it removes UTM, fbclid, gclid, msclkid, mc_cid, and session IDs by default.

HTTP and HTTPS versions both appearing in crawl reports

Enable 'Force HTTPS' and deploy 301 redirects from all http:// URLs to https://. The canonical tag alone is less reliable than a redirect for consolidating HTTP/HTTPS duplication — use both.

WWW and non-WWW versions both indexed

Choose one host preference and apply it consistently: set the canonical tag to the chosen form on all pages, redirect the other form with a 301, and ensure DNS resolves both but redirects immediately to the preferred host.

Inconsistent trailing slashes causing duplicate path variants

Pick a consistent trailing-slash policy and enforce it with redirects and consistent canonical tags. Trailing slash inconsistency is a common source of low-priority crawl duplication. Configure the tool's trailing-slash option to match your site's actual pattern.

Query parameters that change content being stripped from canonicals

Not all query parameters are tracking noise. Parameters like page, lang, color, or size may create genuinely distinct content states that should each have their own canonical URL. Add these to the 'Parameters to always preserve' list to prevent them from being stripped.

Canonical tags being ignored by search engines

A rel="canonical" tag is a recommendation, not a directive. If the declared canonical URL returns a non-200 status, contains substantially different content from the source page, or conflicts with a redirect or hreflang signal, search engines may override it. Verify canonical URLs are live, returning 200, and consistent with other signals.

Frequently asked questions