One product page, four addresses. A shopper can reach the same kettle through the clean product URL, a colour filter, a sorting option and a print view, and every one of those addresses shows the same content. To a search engine, that looks like several near-identical pages competing with each other, and it has to guess which one deserves the credit for links and rankings.

A canonical tag removes the guesswork. It is a single line in a page's <head> section that names the preferred version of the page. This guide shows how to create that line with the free Canonical Tag Generator on Ovatly and install it correctly, whether your page is hand-written HTML or generated by WordPress.

Contents

  • Quick answer
  • What a canonical tag does
  • Where the tag goes: HTML and WordPress
  • How to add a canonical tag, step by step
  • Worked example: canonicalising a filtered product page
  • Self-referencing canonicals
  • Limitations and honest expectations
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Open the Canonical Tag Generator, enter the full, absolute URL of the preferred version of your page (protocol included, for example https://example.com/kettle), choose whether the tag is self-referencing, and copy the generated tag into the <head> of the page and of every duplicate version. Each page should end up with exactly one canonical tag. Treat the tag as a strong hint rather than an order: search engines can pick a different canonical when other signals conflict.

What a canonical tag does

The canonical tag is a link element with rel="canonical". Its href carries the absolute URL of the version you want credited. When similar content exists at several addresses, the tag tells search engines which URL is the preferred version.

The tag only does its job when it appears on every version of the page, not just the preferred one. Placed on both the clean URL and its filtered or printed variants, it tells search engines to credit the clean URL. That credit is the practical point of the exercise: generally, signals from duplicate versions consolidate onto the canonical URL, which is the main reason to set the tag correctly.

Where the tag goes: HTML and WordPress

The destination is the same on every platform: the <head> section of the finished page. On a hand-written HTML page, you open the file and paste the generated line into the <head> yourself. On a WordPress site the pages are generated for you, so the tag has to be added through whatever mechanism your site uses to manage its head output; what matters is the end state, not the route you took to get there.

Verify the end state directly. Load the published page, view its source, and confirm that the <head> contains exactly one canonical tag and that its href is the absolute URL you chose. Do that check on the preferred page and on at least one duplicate version, because the tag belongs on all of them.

How to add a canonical tag, step by step

  1. Open the Canonical Tag Generator and enter the full, absolute URL of the preferred version of the page. Include the protocol: https://example.com/kettle, not /kettle.
  2. Choose whether the tag is self-referencing, which simply means the URL you entered is this page's own address. For the preferred page itself, it is.
  3. Copy the generated tag into the <head> of the page, and of every duplicate version. The filtered, sorted and print variants each need the same line, all pointing at the one preferred URL.

Then run the source check described above. It takes a minute and catches the two failures that quietly undo the whole exercise: a tag that never made it into the output, and a second, conflicting tag left behind by a theme, plugin or older edit.

Worked example: canonicalising a filtered product page

The generator's own example is a shop that shows the same kettle at /kettle and /kettle?color=black. Enter the canonical URL https://example.com/kettle and the tool produces:

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

Placed on both versions, that one line tells search engines to credit the clean URL. The colour variant stays live and keeps working for shoppers; it simply stops competing with the preferred address. Note what the example also shows about form: the URL is absolute and includes the protocol. A relative canonical is unreliable, and the tool rejects it rather than generate a tag that may be ignored.

Self-referencing canonicals

A self-referencing canonical points a page at its own URL, and it is good practice even on a page with no known duplicates. It confirms the preferred address even when parameters or tracking codes get added to links pointing at the page. When someone shares your page with a tracking parameter attached, the tag on the page still names the clean address as the version to credit.

That is why step 2 of the generator asks the question explicitly. For most ordinary pages, the answer is yes: generate the tag with the page's own absolute URL and let it stand guard against the parameterised copies that appear on their own over time.

Limitations and honest expectations

Canonical tags are strong hints, not commands. Search engines can choose a different canonical if signals conflict, for example when internal links point elsewhere. If your tag names one version while your own navigation and in-text links keep sending crawlers to another, you have built the conflict yourself, and the tag may lose.

Two form rules also decide whether the tag counts at all. The URL must be absolute and include the protocol; relative canonicals are unreliable. And every page should have exactly one canonical tag, because multiple conflicting tags are usually ignored. Neither rule is difficult, but both are easy to break silently, which is why the verification step matters.

Common mistakes

  • Using a relative URL. /kettle instead of https://example.com/kettle. The canonical must be absolute, protocol included; the generator rejects relative URLs for this reason.
  • Adding two canonical tags. A page edited by hand and also processed by a theme or plugin can end up with both. Multiple conflicting tags are usually ignored, so the page gets no benefit from either.
  • Tagging only the preferred page. The tag belongs on every duplicate version too. A filtered variant without the tag is still a competing page.
  • Letting internal links disagree. If your own links point at a different version than the tag names, the signals conflict and the search engine may choose a different canonical.

FAQs

Does the canonical URL have to be absolute? Yes. The URL must be absolute and include the protocol; relative canonicals are unreliable, and the Canonical Tag Generator rejects them.

What does self-referencing mean? A self-referencing canonical points a page at its own URL. It is good practice: it confirms the preferred address even when parameters or tracking codes get added to links.

How many canonical tags should a page have? Exactly one. Multiple conflicting canonical tags are usually ignored, so check the finished page and remove any duplicates.

Can the canonical point to another domain? Yes, cross-domain canonicals are supported and are commonly used when the same content is published on two sites, for example a main site and a syndication partner.

Does a canonical pass link value? Generally yes: signals from duplicate versions consolidate onto the canonical URL, which is the main reason to set it correctly.

Conclusion

Adding a canonical tag is three short actions: decide the preferred URL, generate the tag with the Canonical Tag Generator, and place it in the <head> of the page and every duplicate version. The craft is in the checks afterwards: one tag per page, an absolute URL, and internal links that agree with the choice. If you are still deciding whether a tag is even the right tool for your duplicates, read Canonical Tag vs Redirect first. More guides in this series are collected in the SEO Tools guides archive.