- Class
- C2 Recommended
- Weight
- 4
- Severity on fail
- major
- Applies to
Test this rule on a live site with the canonical tag checker or the hreflang checker. Free, no account needed.
Scope and evidence
Evaluated on page (P). The book marks this requirement REQUIRED, SEARCH-ENGINE-SPECIFIC (Deliverable 5); Google's underlying statement is a recommendation.
The consequences are scored by SEO-CANON-01 and SEO-I18N-07, which report this rule as related. Robots meta tags displaced into the body still work for Google (§3.7).
Fail conditions
Each condition has a stable code and a reason template. The evaluator fills the placeholders from observed values only; no sentence in a report is generated.
head_closed_earlyThe parser closed <head> early on {url}: {culprit} at line {line} is not allowed in <head>, so the elements written after it ({displaced}) were placed in <body>. Google advises making sure at least the <head> section is valid HTML, and it only accepts rel="canonical" and hreflang links from the <head>.
The documented fix
Move the culprit into <body>. Tag-manager <iframe> and <noscript> snippets belong immediately after the opening <body> tag; tracking <img> pixels, <div> wrappers and stray text never belong in <head>.
Sources, quoted
These are the passages the rule rests on, stored once in the knowledge base and emitted exactly as written. A citation marked for specific conditions appears only on findings with those codes.
“make sure at least the <head> section is valid HTML”
[G-CANON] How to specify a canonical URL with rel="canonical" and other methods · rel="canonical" link element · last updated 2026-07-10
https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
Related rules
- SEO-CANON-01The canonical link is inside the head
- SEO-I18N-07hreflang links are inside the head