Warning Canonical URL — relative or unexpected

Why rel="canonical" should always use a full absolute URL, and what it means to point at a different page.

The validator checks two things about <link rel="canonical">: that its href is an absolute URL (relative-canonical), and — when checking a live URL — whether the canonical target's path differs from the page you actually fetched (canonical-differs, informational only).

Example

<!-- Wrong: relative -->
<link rel="canonical" href="/blog/my-post">

<!-- Right: absolute -->
<link rel="canonical" href="https://example.com/blog/my-post">

Why it matters

A canonical link tells search engines which URL is the "real" one when the same content is reachable through several URLs — with and without a trailing slash, with tracking parameters, via HTTP and HTTPS, and so on. Search engines consolidate ranking signals to the canonical URL and avoid treating the variants as duplicate content. A relative href works in a browser but is technically ambiguous for crawlers, so the spec-compliant, unambiguous form is always an absolute URL.

A canonical pointing at a genuinely different path isn't necessarily wrong — for example, a print-friendly or AMP version canonicalizing back to the main article — but it's worth double-checking it's intentional rather than a copy-paste mistake from another page's template.

Frequently asked questions

What happens if I don't set a canonical URL?

Search engines will pick one automatically based on their own heuristics, which usually works fine for simple sites. It becomes important once the same content is reachable through multiple URLs — query parameters, trailing slashes, http vs https — where you want explicit control over which one gets indexed.

Can a page's canonical point to itself?

Yes, and that's the common case — most pages set their own absolute URL as their canonical, as a defensive measure against URL variants (tracking parameters, etc.) accidentally getting indexed as separate pages.