head.truncated

<head> is longer than the part that was read. Level: Warning.

When it is raised

Raised when the fetched HTML is longer than 300,000 characters and no closing </head> tag appears in its first 300,000 characters. The limit counts characters of the decoded text, so on a page with non-ASCII text it is not the same as 300 KB, although the message calls it 300 KB. Complete <!-- --> comments are removed from that window first, so a </head> inside one does not count; an unterminated <!-- is kept as text, so a </head> after it still counts. The API returns it before every other finding.

What it does to a shared link

Checks that read the page's tags use only those first 300,000 characters, so a tag reported missing may be present further down the page. WhatsApp's link-preview documentation gives a 300 KB <head> window, and this limit of 300,000 characters is set to match it.

How to fix it

  1. Move large inline scripts, styles, JSON state and SVG out of <head>, or into external files, so that </head> falls inside the first 300,000 characters; this is the change that clears the finding.
  2. Until then, check any tag reported missing by viewing the page source before adding it again.
  3. Move the og: and twitter: tags to the top of <head>, directly after <meta charset>, so they are read; this alone does not clear the finding.
<head> <meta charset="utf-8"> <meta property="og:title" content="Example title"> <meta property="og:description" content="Example description."> <meta property="og:image" content="https://example.com/card.png"> <meta name="twitter:card" content="summary_large_image"> <link rel="stylesheet" href="/main.css"> <script src="/app.js" defer></script> </head>

Related checks

Sources