What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 3 questions

Less than 30 seconds. Find out how much you really know about Google search.

🕒 ~30s 🎯 3 questions 📚 SEO Google

Official statement

If body-related HTML elements (like iframe, div, p, span) are found in the head tag, the HTML lexer automatically closes the head just before these elements and starts the body from there. This is crucial for content injection into the head.
14:14
🎥 Source video

Extracted from a Google Search Central video

⏱ 31:36 💬 EN 📅 09/12/2020 ✂ 11 statements
Watch on YouTube (14:14) →
Other statements from this video 10
  1. 9:26 Caffeine : comment Google transforme-t-il le crawl en indexation ?
  2. 11:02 Comment Google normalise-t-il réellement le HTML cassé de vos pages ?
  3. 11:12 Le style CSS des balises Hn influence-t-il leur poids SEO ?
  4. 12:32 Google indexe-t-il vraiment tous les formats de fichiers au-delà du HTML ?
  5. 13:44 La balise meta keywords a-t-elle encore une quelconque utilité pour le référencement ?
  6. 13:44 Le noindex arrête-t-il vraiment tout traitement par Google ?
  7. 15:52 Google peut-il vraiment distinguer vos soft 404 de vos contenus légitimes sur les pages d'erreur ?
  8. 18:09 Faut-il vraiment désindexer vos pages produits en rupture de stock ?
  9. 23:10 Faut-il vraiment choisir un prestataire SEO dans son fuseau horaire ?
  10. 24:07 Les crawlers tiers sont-ils vraiment plus fiables que Search Console pour tester vos modifs SEO ?
📅
Official statement from (5 years ago)
TL;DR

Google confirms that its HTML lexer automatically closes the <head> tag as soon as it encounters a body-type element (iframe, div, p, span) in that area. Essentially, everything following that element moves to the <body>, making any meta tags, scripts, or structured data placed afterwards ineffective. For SEO, this means a misplaced injection—via a tag manager, a plugin, or a third-party script—can nullify your critical optimizations without triggering any alerts.

What you need to understand

How does the HTML lexer actually interpret the ?

Google's HTML lexer (and modern browsers) applies a strict rule: as soon as an element that is only allowed in the appears in the , the parser considers the to be finished. It automatically closes this section and starts the from that element.

This means that if a

, a '; }