Skip to content

Canonical URL Generator

Generate a canonical <link> tag for any URL.

Loading…

About Canonical URL Generator

Pages that can be reached under several addresses, such as with tracking parameters or a trailing slash, leave search engines to guess which one is the main version. Enter the preferred URL and the tool writes a single link tag that names it. It lowercases the scheme and host, encodes spaces and non-ASCII characters, strips any #fragment and refuses localhost or private addresses. The tag is a hint to search engines, not a redirect, so visitors stay on the page they opened.

Features

  • Writes one rel=canonical link tag
  • Lowercases the scheme and host and encodes spaces and non-ASCII characters
  • Strips the #fragment and tells you it did
  • Rejects localhost, private network and non-http addresses
  • Escapes ampersands in query strings so the tag stays valid HTML

Limitations

  • It writes the tag only. It does not check that the target page exists, returns a success status or matches the page you are tagging.
  • Query strings and trailing slashes stay as you typed them, so decide on the preferred form before you enter it; a bare domain always gets a trailing slash.
  • One address at a time; there is no bulk mode.
  • Downloading canonical.html needs a free account; copying the tag does not.

How it works

  1. Type or paste the full address of the preferred version of the page, starting with http:// or https://.
  2. Read any message under the field: it flags an unusable address, or tells you that a #fragment was removed.
  3. Check the link tag in the output box.
  4. Copy it, or download it as canonical.html.
  5. Paste the tag into the head of the page, and repeat it on every duplicate variant that should point to this URL.

Example input

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

Frequently asked questions