What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 5 questions

Less than a minute. Find out how much you really know about Google search.

🕒 ~1 min 🎯 5 questions

Official statement

Google advocates the use of absolute URLs in the canonical element to prevent potential errors when pages are moved or paths modified. This ensures that the reference to the preferred URL remains accurate and consistent.
15:16
🎥 Source video

Extracted from a Google Search Central video

⏱ 20:14 💬 EN 📅 22/02/2009 ✂ 5 statements
Watch on YouTube (15:16) →
Other statements from this video 4
  1. 8:54 La balise canonical résout-elle vraiment tous vos problèmes de duplicate content ?
  2. 10:49 Faut-il vraiment éviter la balise canonical en priorité ?
  3. 12:57 Le canonical peut-il vraiment fonctionner entre sous-domaines et protocoles différents ?
  4. 13:23 Le canonical remplace-t-il vraiment une redirection 301 en interne ?
📅
Official statement from (17 years ago)
TL;DR

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
Migrating to absolute URLs in canonicals eliminates a source of errors that are often invisible in production but critical during structural changes. If your technical architecture is complex or if you anticipate a future migration, engaging a specialized SEO agency can help you identify specific pitfalls in your context and deploy a robust solution without risk of negative impact on indexing.

❓ Frequently Asked Questions

Un canonical relatif empêche-t-il totalement l'indexation ?
Non, Google peut toujours interpréter un canonical relatif correctement dans la majorité des cas. Le risque apparaît lors de migrations, de changements de structure ou d'environnements multiples où l'URL relative devient ambiguë.
Dois-je inclure les query parameters dans le canonical absolu ?
Uniquement si ces paramètres définissent du contenu unique. Dans la plupart des cas, le canonical doit pointer vers l'URL propre sans paramètres de tracking ou de session.
Que faire si mon CDN sert le site depuis plusieurs domaines ?
Force le canonical à pointer vers ton domaine principal de production, pas vers l'URL du CDN. Configure ton CMS ou tes templates pour utiliser une constante définie explicitement, indépendamment de l'origine de la requête.
Google pénalise-t-il les canonicals relatifs ?
Non, il n'y a pas de pénalité. Google peut simplement ignorer la directive s'il la juge ambiguë ou incorrecte, et choisir lui-même la version canonique selon ses propres critères.
Comment tester rapidement si mes canonicals sont corrects ?
Crawle quelques pages clés et vérifie que le canonical commence par https:// avec ton domaine complet. Vérifie aussi via la Search Console : les URLs indexées doivent correspondre aux URLs canoniques déclarées.
🏷 Related Topics
Domain Age & History Crawl & Indexing Domain Name

🎥 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 →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.