Un elemento no válido cierra el head antes de las etiquetas SEO
En Neova Se ejecuta a partir del propio rastreo: no hay nada que configurar.
Regla revisada por última vez el 17 de octubre de 2026 · Guía actualizada el 17 de octubre de 2026
Google solo lee los metadatos de un head válido e ignora lo que viene después de un elemento no válido. Una etiqueta de título, canonical, robots o hreflang situada después de ese elemento puede pasarse por alto.
Qué puedes hacer
Mueve el elemento no válido al body o coloca todas las etiquetas SEO encima de él.
Por qué Neova lo señala
La guía de metadatos de Google dice que ignora cualquier elemento del head que venga después de un elemento no válido.
Solo title, meta, link, script, style, base, noscript y template van en el head; cualquier otra cosa lo cierra.
Los buscadores pueden pasar por alto una etiqueta de título, canonical, robots o hreflang situada después de ese elemento.
This check fires when your <head> contains an element that doesn't belong there, a stray <div>, a <p>, an <img>, or even loose text. The stakes are blunt: browsers and Google auto-close the head the instant they hit an invalid element, so anything after that point, your canonical, your hreflang, your Open Graph tags, gets shoved into the body and silently ignored. Your meta robots lands there too; Google says it still respects a robots meta tag in the body, but other crawlers may not.
Why a Single Stray Tag Wipes Out Your Meta Tags
The HTML spec allows only a specific, short list of elements inside <head>. When a parser encounters anything else, it doesn't error out, it assumes you forgot to write </head><body> and closes the head for you, right there. Every valid <meta>, <link>, or <script> that came after the offending element is now parsed as body content. A <link rel="canonical"> in the body is not a canonical, it's decoration Google throws away. Same for hreflang. Meta robots is the exception: Google says it respects a robots meta tag in the body, though other crawlers may not. You didn't lose the tag; you lost its meaning.
Here is a real one, a tracking snippet dumped a <div> into the head, and the canonical below it died:
The browser rewrites that as if </head><body> sat right before the <div>. The canonical and robots tag are in the body now. To Google, this page has no declared canonical and no robots directive, it falls back to defaults and guesses.
The Only Elements Allowed in the Head
Allowed in <head>
What It's For
Common Invalid Intruders
<title>
Page title (exactly one)
<div>, <section>
<meta>
Charset, robots, viewport, OG/Twitter
<p>, loose text
<link>
Canonical, stylesheets, hreflang, icons
<img>, <a>
<style>
Inline CSS
<h1>, <h6>
<script> / <noscript>
JS and no-JS fallbacks
<iframe>, <table>
<base>
Base URL for relative links (at most one)
<button>, <form>
<template>
Inert markup fragment
unencoded &, <, or > as text
If it isn't in the left column, it terminates the head early. A frequent surprise: raw text, even a stray comment fragment or an ampersand outside a tag, counts as an intruder, because text nodes aren't allowed as direct children of <head> either.
How to Detect It
View Source vs. rendered DOM: open raw source (Ctrl+U) and read the head top to bottom looking for anything that isn't title/meta/link/style/script/base. Then open DevTools Elements and check where </head> actually sits in the parsed DOM, if it closed earlier than your source shows, the browser found an intruder. The gap between the two views is the tell.
GSC URL Inspection (rendered HTML): inspect the URL, open "View crawled page," and check whether Google's rendered head still contains your canonical and robots tags. If they've fallen into the body, Google is confirming the early-close for you.
Screaming Frog: crawl, then check whether canonicals and meta robots that should exist show as empty or "Missing." A template that clearly outputs a canonical but reports none across a URL group is a strong signal the head is closing early.
W3C validator or a linter: run the URL through an HTML validator; "Element X not allowed as child of element head" pins the exact intruder and line number faster than eyeballing.
How to Fix It
Find the first invalid element in the head and either move it into the body or delete it. Injected analytics and consent snippets are the usual culprits, a GTM container's <noscript><iframe> block belongs immediately after the opening <body>, not in the head. Corrected:
<head>
<meta charset="utf-8">
<title>Running Shoes</title>
<link rel="canonical" href="https://example.com/shoes/running/">
<meta name="robots" content="index, follow">
</head>
<body>
<div id="gtm-noscript"></div> <!-- moved into body -->
Then confirm the fix in the rendered DOM: reload, open DevTools, and verify </head> now closes after your last meta tag. Re-inspect in Search Console so Google re-renders and picks the canonical and robots directive back up. If a plugin or tag manager is injecting the intruder, fix it at the source, patching the output once won't survive the next template render.
False Positives and Edge Cases
Some checkers flag <noscript> or a <script> that itself contains markup-looking strings. Those are valid in the head, a <noscript> holding a <link> or <style> is legal, and a script's inner text isn't parsed as head children. If the tool flags one of these but your canonical and robots tags still resolve correctly in the rendered DOM, it's a false positive; verify with the DOM before you go rearranging templates. The real test is always: does </head> close where you expect in the parsed page?
FAQ
Why Does One Bad Tag Kill Everything After It and Not Just Itself?
Because the parser reacts to an invalid head child by inserting an implicit </head><body> at that spot. It's not skipping the one tag, it's declaring the head over. Everything downstream inherits body context, so all your remaining meta/link tags become inert.
Will Invalid Comments Break the Head?
Well-formed comments (<!-- ... -->) are fine in the head. A malformed comment or raw text that looks like a comment but isn't closed properly can spill into a text node and trip the early-close. When in doubt, validate.
My Canonical Is in the Source, Why Does Google Say It's Missing?
Because "in the source" and "in the head" aren't the same thing once an intruder closes the head early. Check the rendered DOM: if the canonical sits below the implicit </head>, Google reads it as body content and ignores it. This is one of the sneakier causes behind a missing canonical tag.
Does This Affect Meta Robots Too, or Only Canonicals?
Everything below the intruder is affected, canonical, meta robots, hreflang, viewport, Open Graph, the lot. If your robots directive fell into the body, Google says it still respects it, but other crawlers may fall back to indexing defaults, so move it back into the head. See the meta robots outside head check for the robots-specific symptom of the same root cause.
Where Should Injected Third-Party Markup Go Instead?
Non-head elements (iframes, noscript image beacons, divs) belong in the body, typically right after <body>. Only title, meta, link, style, script, base, and template are legal head children. For the full picture of how a broken head cascades into indexing problems, the canonical tags reference walks through discovery and consolidation once your tags actually parse.
Encuéntralo en tu propio sitio
Neova ejecuta esta comprobación y todas las demás en cada rastreo, y luego escribe la corrección como un ticket para tu equipo.
App de escritorio para Mac, Windows y Linux
Las 696 comprobaciones, cada una con su fuente
Search Console y Analytics 4, conectados en solo lectura
Tickets para Jira, Linear y Asana
Descargar NeovaPlan Desktop Free, o Solo gratis durante 14 días, sin tarjeta.