head.closed-early

ErrorSEO audit

An element that does not belong in <head> (an <img>, <iframe>, <div>, stray text) ends it early, so search engines read the metadata after it as part of <body> and ignore it.

What to change

Move the element out of <head>, into <body>, or at least below every <title>, <meta> and <link>. Only <title>, <meta>, <link>, <script>, <style>, <base>, <noscript> and <template> belong in <head>. A tag manager's or ad pixel's <noscript><iframe> or <img> goes right after the opening <body> tag.

The documentation on developers.google.com

A finding of this rule on a page carries the exact edits for that page: the markup it quotes, and what to write instead.

When it runs

Runs on every SEO audit: of a page, a crawl, a build directory or HTML. An error is a problem that keeps a page out of search or out of answers, or breaks how it shows there. Each finding takes 15 points off the page's score.

The severity here is the rule's usual one: a finding can be raised or lowered when the page gives a reason.

Run it, or skip it

Check a page for this rule alone, after a fix for instance:

npx @rivi-software/agentic-seo-check audit https://example.com --rule head.closed-early

Or from an assistant, with the MCP tool seo_audit_page:

{
  "url": "https://example.com",
  "rules": [
    "head.closed-early"
  ]
}

To leave it out of an audit, pass --disable head.closed-early on the command, or disableRules: ["head.closed-early"] to a tool.

All 12 rules