In short. Use an absolute URL in a canonical link because Google recommends it and says relative paths can cause problems over time.
Definition: Yes. Google recommends an absolute URL in a
rel="canonical"link element. Google supports relative paths, but says they can cause problems over time, including when a testing site becomes crawlable.
Key facts
- Google's canonicalization documentation recommends absolute paths rather than relative paths in a
rel="canonical"link element. - Google gives
https://www.example.com/dresses/green/green-dress.htmlas a good example and/dresses/green/green-dress.htmlas a bad example. - The canonical link element is accepted only when it appears in the HTML
<head>section. - Google describes
rel="canonical"link annotations as a strong signal for the specified URL. - RFC 3986 defines a relative reference as a reference resolved against a base URI, while an absolute URI contains a scheme such as
https:.
What is the difference between the two forms?
An absolute URL identifies the scheme and host as well as the path. A relative reference supplies only part of the address and depends on a base URI. RFC 3986 says that a relative reference is resolved against the name space of another hierarchical URI, and that the base URI must be established before relative references are parsed.
For a canonical link, the full URL makes the target visible in the element itself:
<link rel="canonical" href="https://example.com/dresses/green-dresses" />
The leading slash in /dresses/green/green-dress.html does not make the reference an absolute URL. RFC 3986 calls that form an absolute-path reference, which is still a relative reference because it has no scheme or authority.
Why does Google recommend an absolute URL?
Google's documentation states that relative paths are supported, then gives the reason for its recommendation: they can cause problems in the long run, for example if a testing site is unintentionally allowed to be crawled. The practical result is that the canonical target remains tied to the document's current base context when the shorter form is used, while the full form states the intended scheme, host, and path together.
Google also says that canonical methods are signals rather than required fields. When a site does not specify a canonical URL, Google identifies which version is objectively the best version to show in Search. When a site does specify one, Google describes the rel="canonical" annotation as a strong signal, so the value should identify the intended page precisely.
How should a site check the element?
The element belongs in the HTML <head>, and Google's documentation says it is accepted only there. A page template can therefore be checked for three properties: the href starts with the intended scheme and host, the path identifies the canonical page, and the element is present in the source <head>.
Google recommends placing the canonical URL in the HTML source when client-side rendering is used and making sure JavaScript does not change the canonical link element. If a server sends a rel="canonical" HTTP response header instead, Google gives an example using a full URL and says to use absolute URLs in that header as well.
Related terms
FAQ
Is /page invalid in a canonical link?
No. Google documents that relative paths are supported, while recommending absolute paths because relative paths can cause problems over time.
What should you put in href?
Use the complete canonical URL, including its scheme, host, and path. Google's example is https://www.example.com/dresses/green/green-dress.html.
Does the same rule apply to the HTTP header?
Yes. Google says to use absolute URLs in a rel="canonical" HTTP header as with the HTML link element.
Sources
- Google Search Central, "How to specify a canonical URL with rel="canonical" and other methods", 2026-07-10
- IETF, "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax", January 2005
Check how a page reads to answer engines. Open the GEO score analyzer