Why it matters
- Only some elements belong in
<head>:title,meta,link,script,style,base,noscriptandtemplate. Google's documentation says that when it meets another one, such as an<img>or an<iframe>, it assumes<head>has ended and ignores the elements after it. - Tracking snippets often put a one-pixel
<img>or an<iframe>in<head>. Store themes and plugins sometimes print stray text there, such as a no-break space. Everything after it is lost: the canonical address, the robots rules, hreflang links, the description, even the title. - Browsers show the page normally, so nobody notices. The metadata is in the HTML, but it is no longer in
<head>as a parser reads it.
Example
<title>عطر العود الملكي | متجر الواحة</title> <meta property="og:title" content="عطر العود الملكي | متجر الواحة" /> <meta property="og:description" content="عطر عود ملكي بتركيز عالٍ، في زجاجة من 50 مل." /> <meta property="og:image" content="https://www.example.com/og.png" /> <img src="https://tr.example.com/pixel.gif?id=73" width="1" height="1" alt="" /> <meta name="description" content="عطر عود ملكي بتركيز عالٍ، في زجاجة من 50 مل." /> <link rel="canonical" href="/" /> </head>
<meta property="og:image" content="https://www.example.com/og.png" /> <meta name="description" content="عطر عود ملكي بتركيز عالٍ، في زجاجة من 50 مل." /> <link rel="canonical" href="/" /> </head> <body> <img src="https://tr.example.com/pixel.gif?id=73" width="1" height="1" alt="" />
How to fix
Move what does not belong in <head> into <body>, or put the metadata before it:
html
<head>
<title>عطر العود الملكي | متجر الواحة</title>
<meta name="description" content="…" />
<link rel="canonical" href="https://shop.example/ar/عود" />
</head>
<body>
<img src="https://tr.example.com/pixel.gif?id=73" width="1" height="1" alt="" />- A pixel's fallback
<img>inside<noscript>is valid in<head>; a bare one is not. - Look for text between tags in
<head>: an , a stray character, or a plugin's message printed into the template. - In a tag manager, add pixels to the body, not to the head.
How we detect
- We read the HTML as the server sends it, with the parser browsers use, scripts on (so a
<noscript>in<head>is read as text, as browsers read it, and ends nothing). - When
<head>ended before the page's own</head>or<body>, we take the element or text that ended it. - We list the metadata the parser then placed in the body:
<title>,<meta>with a name, property orhttp-equiv(not microdata'sitemprop), and<link>relations that only mean something in<head>. - We report it only when that list holds something search reads: the title, the description, robots rules, the canonical address or an hreflang link. Open Graph tags and style sheets alone are not reported.
A page that writes neither </head> nor <body> starts its body at its first content, which HTML allows: that is not reported. Elements a script adds to <head> after the page loads are not read here.