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

The rel canonical, robots meta, and hreflang tags must be placed within the head section of the page. If HTML elements break the head and prematurely open the body, these critical tags can be ignored by Google.
19:58
🎥 Source video

Extracted from a Google Search Central video

⏱ 56:54 💬 EN 📅 16/10/2020 ✂ 39 statements
Watch on YouTube (19:58) →
Other statements from this video 38
  1. 2:02 Are link exchanges for content really punishable by Google?
  2. 2:02 Can you really use lazy loading and data-nosnippet to control what Google displays in the SERPs?
  3. 2:22 Can exchanging content for backlinks trigger a Google penalty?
  4. 2:22 Should you really use data-nosnippet to control your search snippets?
  5. 2:22 Should you really ban external reviews from your Schema.org structured data?
  6. 3:38 Does a 1:1 domain migration truly transfer ALL ranking signals?
  7. 3:39 Does a domain migration really transfer all ranking signals?
  8. 5:11 Why doesn't merging two websites ever double your SEO traffic?
  9. 5:11 Why does merging two websites lead to traffic loss even with perfect redirects?
  10. 6:26 Should you really think twice before splitting your site into multiple domains?
  11. 6:36 Is splitting a website into multiple domains a strategic mistake to avoid?
  12. 8:22 Can a polluted domain really handicap your SEO for over a year?
  13. 8:24 Can the history of an expired domain hold back your rankings for months?
  14. 14:03 Does Google really evaluate Core Web Vitals by section or does it apply to the entire domain?
  15. 14:06 Can Google really evaluate Core Web Vitals section by section on your site?
  16. 19:27 Why does Google ignore your canonical and hreflang tags if your HTML is poorly structured?
  17. 23:39 Do you really need to specify a time zone in the lastmod tag of your XML sitemap?
  18. 23:39 How might a missing timezone in your XML sitemaps jeopardize your crawl?
  19. 24:40 Why does Google ignore identical lastmod dates in your XML sitemaps?
  20. 24:40 Why does Google ignore identical modification dates in XML sitemaps?
  21. 25:44 How does alternating between noindex and index jeopardize your crawl budget?
  22. 25:44 Is alternating between index and noindex really dooming your pages to Google's oblivion?
  23. 29:59 Does the Ad Experience Report really influence Google rankings?
  24. 29:59 Does the Ad Experience Report really influence Google rankings?
  25. 33:29 Is it really necessary to break all your pagination links for Google to prioritize page 1?
  26. 33:42 Should you really prioritize incremental linking for pagination instead of linking everything from page 1?
  27. 37:31 Why do your rendering tests fail while Google indexes your page correctly?
  28. 39:27 How does Google really index your pages: by keywords or by documents?
  29. 39:27 Does Google really create keywords from your content, or is the process the other way around?
  30. 40:30 How does Google manage to comprehend 15% of queries it has never seen before through machine learning?
  31. 43:03 Why does recovery from a Page Layout penalty take months?
  32. 43:04 How long does it really take to recover from a Page Layout Algorithm penalty?
  33. 44:36 Does Google impose a maximum threshold for ads within the viewport?
  34. 47:29 Does content syndication really harm your organic search ranking?
  35. 51:31 Does a 302 redirect ultimately equate to a 301 in terms of SEO?
  36. 51:31 Should You Really Worry About 302 Redirects During a Migration Error?
  37. 53:34 Should you really host your news blog on the same domain as your product site?
  38. 53:40 Should you isolate your blog or news section on a separate domain?
📅
Official statement from (5 years ago)
TL;DR

Google ignores rel canonical, robots meta, and hreflang tags if they are outside the head section of the HTML. A single improperly closed or misplaced element can break the head and prematurely open the body, rendering these directives invisible to the crawler. Specifically, your indexing, language, or canonicalization instructions could end up in the trash without you knowing.

What you need to understand

What can break the head section of a page?

The problem arises when an unauthorized HTML element appears in the <head>. Browsers and crawlers are programmed to automatically close the head as soon as they encounter a tag that doesn’t belong there — typically a <div>, <img>, <script> in the wrong place, or even a simple piece of plain text.

The result: everything that follows is deemed to belong to the <body>, even if your code still syntactically indicates it’s in the head. Google reads the DOM reconstructed by the browser, not your raw source. If your canonical or hreflang appears after this breaking point, it is never processed.

Why doesn’t Google forgive this error?

Crawlers adhere to W3C HTML standards. These standards enforce a strict structure: the head contains metadata, the body contains visible content. When a foreign element forces the head to close, it is the rendering engine (Chromium for Googlebot) that decides on the restructuring — Google has no “benevolent” logic to recover your lost SEO tags.

Specifically, if your CMS, tagging system, or a plugin inserts a <div> before your canonical, you’re presenting Google with a page devoid of canonicalization directives. It will then decide which version to index on its own, often based on other signals (backlinks, content similarity). And that’s where the issue arises.

How do such bugs appear in production?

The most common cases: badly coded templates, WordPress plugins that inject tracking or advertising pixels directly into the head without adhering to syntax, poorly implemented Google Tag Manager tags, or PHP conditions that generate HTML outside of the allowed tags.

Another classic source: multilingual management systems that inject content (cookie consent banners, for example) at the top of the page via JavaScript, but whose server-side rendering breaks the head. The developer sees a functional page in Chrome, but the final DOM sent to Googlebot is broken.

  • A single misplaced tag is enough to invalidate all subsequent critical SEO tags.
  • Google reads the reconstructed DOM, not your source HTML — basic validation tools don’t always detect the problem.
  • The tags in question: rel=canonical, meta robots, hreflang, but also Open Graph and other structured metadata if they are in the head.
  • Mobile crawling (via Googlebot Smartphone) is particularly sensitive to these errors, as some mobile scripts inject content more aggressively.
  • A page can be correctly indexed for months, then lose its directives after a technical deployment that introduces a breaking element.

SEO Expert opinion

Is this statement consistent with ground observations?

Absolutely. I’ve seen sites lose their canonicals on tens of thousands of pages due to an A/B testing plugin injecting an invisible <div> at the top of the head. Google started indexing the wrong versions, resulting in keyword cannibalization.

The trap: conventional HTML validation tools (W3C Validator) flag the error, but it’s buried among hundreds of other warnings. SEOs don't systematically check the final DOM rendering, especially when the page looks normal. The result: the bug goes unnoticed until an audit detects massive indexing anomalies.

In which cases can this rule pose a problem even without HTML errors?

Sites with third-party content injection (ad tech, real-time personalization, multivariate testing) are particularly exposed. An advertising partner can push a script that modifies the DOM on-the-fly — and if this script executes before Googlebot captures the final page, your SEO tags may disappear.

Another case: JavaScript frameworks (React, Vue, Next.js) that generate the head client-side. If the SSR (Server-Side Rendering) is misconfigured or if Googlebot crawls before the JS fully executes, tags may be missing or misplaced. [To be verified] — Google claims to crawl modern JS effectively, but inconsistencies are still observed on complex sites with heavy script waterfalls.

What nuances should be brought to this directive?

The first nuance: not all elements in the head are critical at the same level. Google may tolerate a misplaced Open Graph (it will still read it for social snippets), but a meta robots noindex outside the head is purely ignored — the page will be indexed.

The second point: the HTTP/2 Server Push version and HTTP Link headers can partially bypass the problem for canonicals and hreflang (sending via HTTP headers instead of HTML). However, this approach remains marginal and complex to maintain. In practice, 99% of sites must ensure their HTML head is clean.

Warning: do not rely solely on the display in Chrome DevTools. Use the URL inspection tool in the Search Console to see the DOM actually crawled by Googlebot — that’s where you’ll detect if your critical SEO tags are present or not.

Practical impact and recommendations

How to verify that your head is valid and that your SEO tags are being considered?

Your first reflex: test with Google's URL inspection tool in Search Console. Request a live crawl, wait for the rendering, then inspect the crawled HTML code. Look for your rel=canonical, meta robots, hreflang. If they don’t appear in the head or are absent, you have a problem.

The second verification: validate your HTML with the W3C Markup Validation Service. Focus on errors in the <head>, ignore cosmetic noise. Any error like "tag X not allowed in head" or "stray tag before head closed" is a red flag. Fix them one by one.

What errors should be avoided when implementing these tags?

Never let a plugin or tag manager inject content before the closing of the <head> without verifying the final rendering. Tracking scripts (Google Analytics, Facebook Pixel) must be in properly closed <script> tags, never in bulk with surrounding HTML.

Avoid server conditions (PHP, JSP, ASP.NET) that generate text or visual tags in the head. For instance, a PHP error message displaying a <div> before the </head> breaks everything. The same goes for server-side injected GDPR banners: they must be in the body, not the head.

What to do if you detect a broken head on your site?

Identify the source: disable your plugins one by one (on a test environment) and re-crawl the inspection after each deactivation. As soon as the head becomes clean again, you’ve found the culprit. If it’s an essential plugin, contact the publisher or code a custom fix.

For sites with a lot of JS, switch to Server-Side Rendering (SSR) or Static Site Generation (SSG) to ensure that SEO tags are present in the initial HTML, before any JavaScript execution. Next.js, Nuxt.js, Gatsby are frameworks that handle this natively.

  • Test each page template (homepage, category, product, article) with the URL inspection tool in the Search Console.
  • Ensure that rel=canonical, meta robots, hreflang are indeed present in the <head> of the crawled DOM.
  • Use an HTML validator (W3C) and fix all errors in the <head>, even those that seem minor.
  • Audit your third-party scripts (tag managers, pixels, A/B testing): ensure they don’t inject anything that could prematurely close the head.
  • Set up automatic monitoring (via a Screaming Frog or OnCrawl crawler) to detect pages where critical tags are absent or improperly positioned.
  • Document template changes and systematically re-test after each deployment — a plugin update can reintroduce the bug.
A broken HTML head is a ticking time bomb for your indexing. Google doesn’t guess your intentions: if your critical SEO tags are outside the head, they do not exist. Technical validation should become a reflex before every production release. These optimizations can be complex to implement alone, especially on architectures with multiple third-party dependencies or advanced JavaScript stacks. Engaging a specialized SEO agency for personalized support helps detect and correct these invisible technical errors while avoiding regressions during site evolutions.

❓ Frequently Asked Questions

Google peut-il lire les balises canonical ou hreflang placées dans le body ?
Non. Google ignore totalement les balises rel canonical, meta robots et hreflang si elles se trouvent en dehors du <head>. Seules les balises correctement positionnées dans le head sont prises en compte.
Comment savoir si mon head est cassé sans outils payants ?
Utilisez l'outil d'inspection d'URL de Google Search Console (gratuit). Demandez un crawl en direct, attendez le rendu, puis examinez le code HTML crawlé pour vérifier la présence de vos balises SEO dans le <head>.
Un plugin WordPress peut-il casser le head sans que je le voie ?
Absolument. Certains plugins de tracking, bannières cookies ou A/B testing injectent du HTML mal formé dans le head, cassant la structure sans affecter l'affichage visuel. Le DOM final vu par Google est différent de votre source.
Les balises hreflang envoyées via HTTP headers sont-elles une alternative fiable ?
Oui, techniquement. Google accepte les hreflang via HTTP headers (Link:), ce qui contourne le problème du head cassé. Mais cette méthode est plus complexe à implémenter et maintenir — réservée aux cas avancés ou aux sites avec contraintes techniques fortes.
Si mon canonical est ignoré, quelle version Google indexe-t-il ?
Google choisira la version qu'il juge la plus pertinente selon ses propres signaux : backlinks, contenu similaire, historique de crawl. Vous perdez le contrôle et risquez de voir indexée une URL non souhaitée, créant des problèmes de cannibalisation.
🏷 Related Topics
Domain Age & History Crawl & Indexing International SEO

🎥 From the same video 38

Other SEO insights extracted from this same Google Search Central video · duration 56 min · published on 16/10/2020

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