SEO

How to set a canonical URL.

Tracking parameters, mixed hex casing, and trailing-slash variants can make one page look like many different URLs to search engines — splitting its ranking signals. A rel="canonical" tag tells them which URL is the real one. Here’s how to use it correctly.

What a canonical tag does

It points every duplicate variant at one preferred URL, so search engines consolidate ranking signals onto that one page instead of splitting them:

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

Put it in the <head> of every variant. All these URLs would carry the same canonical pointing at the clean one:

https://example.com/products/shoes?utm_source=newsletter
https://example.com/products/shoes?ref=twitter&fbclid=abc
https://example.com/products/shoes/       (trailing slash)
https://example.com/products/shoes#reviews

How encoding creates accidental duplicates

Two encoding-specific traps generate duplicate URLs that a canonical tag fixes:

Common mistakes

MistakeWhy it’s wrong
Relative canonical URLUse an absolute URL with scheme and host — relative ones are error-prone.
Canonical to a redirecting or 404 URLIt must point to a live, indexable 200 page.
Every page canonical to the homepageA frequent CMS bug — it de-indexes your real pages.
Canonical + noindex togetherConflicting signals; pick one intent per page.

It’s a hint, not a command

Google treats rel=canonical as a strong signal but not an absolute directive — it may pick a different canonical if other signals disagree. Reinforce it by making internal links point to the canonical URL, keeping it in your sitemap, and (for parameters) configuring parameter handling. For a deeper look at how parameters multiply URLs, see our faceted-navigation guide.

Not sure whether two encoded URLs are actually the same page? Decode both with the URL decoder and compare.

About this page

Written and maintained by the urlencodedecode.com team. Every technical claim on this page is verified against primary sources — the RFCs (3986, 3629, 4648, 7578), the WHATWG URL Standard, and official vendor or language documentation — rather than second-hand summaries. When a source contradicts a common assumption, we follow the source and note the discrepancy. Corrections: contactus@urlencodedecode.com.

Common questions

Frequently asked.

A canonical URL is the single preferred version of a page that you want search engines to index when several URLs show the same content. You declare it with a rel="canonical" link tag in the head, and search engines consolidate ranking signals onto that URL.

Add a rel="canonical" tag pointing to the clean, parameter-free URL on every variant. So a page reached with ?utm_source=... still declares the canonical as the version without tracking parameters, consolidating its signals onto one URL.

They can. The hex digits are case-insensitive per RFC 3986, so both decode to the same character, but many crawlers treat the raw strings as distinct URLs and may index them separately. Normalize percent-encoding to uppercase and set a canonical to consolidate them.

Absolute — include the scheme and host, e.g. https://example.com/page. Relative canonical URLs are error-prone and can resolve incorrectly. Also make sure the canonical points to a live 200 page, not a redirect or 404.

No. Google treats rel=canonical as a strong hint, not an absolute command, and may choose a different canonical if other signals conflict. Reinforce it by linking internally to the canonical URL, listing only the canonical in your sitemap, and avoiding contradictory signals like noindex.

Related

Keep exploring.