head.metadata-in-body

WarningSEO audit

Metadata that search engines read only in <head> (title, meta description, viewport, canonical, hreflang) is written in <body> (warning). Metadata a framework streams into a hidden part of <body> and moves into <head> with JavaScript, as Next.js does for an async generateMetadata, is info. Robots meta tags are not reported: Google honours them in <body> too.

What to change

Move these elements into <head>. Google accepts rel=canonical only in <head>. A framework that renders them in a page component usually has a head API for them (metadata export, <Head>, useHead, <svelte:head>).

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. A warning is a problem that costs a page ranking, clicks or citations. Each finding takes 5 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.metadata-in-body

Or from an assistant, with the MCP tool seo_audit_page:

{
  "url": "https://example.com",
  "rules": [
    "head.metadata-in-body"
  ]
}

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

All 12 rules