Official statement
Other statements from this video 4 ▾
- 8:54 La balise canonical résout-elle vraiment tous vos problèmes de duplicate content ?
- 10:49 Faut-il vraiment éviter la balise canonical en priorité ?
- 12:57 Le canonical peut-il vraiment fonctionner entre sous-domaines et protocoles différents ?
- 13:23 Le canonical remplace-t-il vraiment une redirection 301 en interne ?
Google explicitly recommends the use of absolute URLs in canonical tags to avoid errors during migrations or structure changes. A relative URL may point to the wrong target if the context changes, diluting the canonicalization signal. In practical terms, a site using relative canonicals risks having Google completely ignore these directives if resources are moved.
What you need to understand
What’s the difference between an absolute and a relative URL in a canonical?
An absolute URL includes the protocol and the full domain (https://example.com/page/), while a relative URL only contains the path (/page/). In the context of a canonical tag, this distinction becomes critical.
When a CMS generates a relative canonical, the browser or bot reconstructs the complete URL based on the context of the current page. If this page is moved, duplicated in a staging environment, or accessible through multiple paths, the canonical may point to a non-intended destination. Google then faces an ambiguous directive that it may choose to ignore.
Why is this recommendation appearing now?
Google is likely seeing an increase in canonicalization errors related to modern architectures: headless sites, JAMstack, multiple CDNs, preview environments. In these contexts, the same page can be served from multiple origins.
A relative canonical becomes a trap. Imagine a staging environment that is accessible to bots: the relative canonical points to the staging version, not the production one. Google indexes the wrong URL, and you lose control of your canonicalization signal. The absolute URL removes this ambiguity by explicitly specifying the destination.
What are the real risks for a production site?
The first risk is PageRank dilution. If Google cannot determine which URL is the canonical version, it splits the signals between multiple variants. Your content loses authority, and your rankings suffer.
The second risk pertains to migrations. During a change in structure or domain, a relative canonical can create loops or point to outdated URLs. Google detects the inconsistency and may decide not to follow the directive, choosing the canonical version based on its own criteria.
- Absolute URLs: https://example.com/page/ - explicit and unambiguous directive
- Relative URLs: /page/ - depends on execution context, source of errors
- At-risk contexts: accessible staging, multiple CDNs, headless sites, ongoing migrations
- Direct consequence: Google may ignore the canonical and choose its own preferred version
- SEO impact: PageRank dilution, indexing of incorrect variants, loss of control over the canonicalization signal
SEO Expert opinion
Is this directive consistent with observed field practices?
Absolutely. Technical audits regularly reveal sites where relative canonicals create invisible inconsistencies in production but are catastrophic in testing environments. Google has probably seen enough cases to formalize this recommendation.
That said, most modern CMS platforms already generate absolute URLs by default in canonicals. WordPress, Shopify, Magento: all use complete URLs. This reminder primarily targets custom developments and legacy sites where canonicals are hardcoded relatively.
In what cases can this rule be problematic?
Paradoxically, certain technical contexts make managing the absolute URL more complex. A multi-domain or multilingual site with variations in protocol (HTTP/HTTPS) or subdomains must ensure that the canonical always points to the intended main version.
If your CMS dynamically generates the canonical based on the current request URL, you could end up with canonicals pointing to www. when you want the non-www. version, or vice versa. The absolute URL only resolves the issue if it is correctly configured, not just technically absolute.
Should I immediately correct all existing relative canonicals?
If your site is functioning correctly, Google is indexing the right URLs, and you do not have duplicate content, the priority is not urgent. However, during your next migration, redesign, or technical optimization, switch to absolute URLs.
The real risk arises during changes: HTTPS migration, change in structure, deployment of CDNs, or accessible staging environments. In these contexts, a relative canonical can silently derail. It’s better to anticipate and standardize now than to rush to debug after an unexplained traffic drop.
Practical impact and recommendations
How can I check if my site is using relative or absolute URLs?
Crawl your site with Screaming Frog or Sitebulb and export the column "Canonical Link Element." If you see values starting with “/” without protocol or domain, you have relative canonicals.
Also check the staging environments: access a test page and inspect the source code. If the canonical points to the staging URL instead of production, you have a dynamic generation issue to fix. A tool such as OnCrawl can compare canonicals between environments and detect inconsistencies.
What specific technical correction should be applied?
If you are using a CMS, look in the settings for the option that controls canonical generation. WordPress by default generates absolute URLs via Yoast or RankMath. Ensure that the site's URL is correctly configured in Settings > General.
For custom development, modify the templates to build the canonical with a function that always returns the complete domain. In PHP: $canonical = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - but be careful with query parameters and fragments that should not appear in the canonical.
What pitfalls should be avoided when migrating to absolute URLs?
The classic trap: generating the canonical based on the current request URL without validation. If your site is accessible via multiple domains (www/non-www, HTTP/HTTPS, old domains not redirected), you risk creating divergent canonicals.
Force the canonical generation from a constant or an environment variable that defines the main site URL. Never base it on $_SERVER['HTTP_HOST'] without prior validation. An attacker could theoretically inject a malicious domain in the Host header and pollute your canonicals.
- Crawl your site to identify existing relative canonicals
- Ensure your CMS is configured with the correct production URL
- Test staging environments: the canonical should point to production
- Force the use of a constant for the main domain, do not rely on the current request
- Exclude query parameters and fragments (#) from the canonical unless relevant
- Verify after deployment that all canonicals correctly point to HTTPS and the intended www/non-www version
❓ Frequently Asked Questions
Un canonical relatif empêche-t-il totalement l'indexation ?
Dois-je inclure les query parameters dans le canonical absolu ?
Que faire si mon CDN sert le site depuis plusieurs domaines ?
Google pénalise-t-il les canonicals relatifs ?
Comment tester rapidement si mes canonicals sont corrects ?
🎥 From the same video 4
Other SEO insights extracted from this same Google Search Central video · duration 20 min · published on 22/02/2009
🎥 Watch the full video on YouTube →
💬 Comments (0)
Be the first to comment.