Issues

Validation: Invalid HTML Elements In <head>

back to issues overview

Invalid HTML Elements In <head>

Pages with invalid HTML elements within the <head>. When an invalid element is used in the <head>, Google assumes the end of the <head> element and ignores any elements that appear after the invalid element.

This means critical <head> elements that appear after the invalid element will not be seen.

The <head> element as per the HTML standard is reserved only for the following elements:

  • <title>
  • <meta>
  • <link>
  • <script>
  • <style>
  • <base>
  • <noscript>
  • <template>

Some of the most common elements that appear in the <head>, that will cause issues include –

  • <iframe>
  • <img>
  • <svg>
  • <div>
  • <noscript> containing an <img>

How to Analyse in the SEO Spider

View URLs with this issue in the ‘Validation’ tab and ‘Invalid HTML Elements In <head>’ filter, and export all URLs using the ‘Export’ button.

Read our tutorial on ‘How To Debug Invalid HTML Elements In The Head‘.

What Triggers This Issue

This issue is triggered when pages contain invalid HTML elements within the <head> section.

Example:

<!DOCTYPE html>
<html>
<head>
<h1>I really shouldn't be here!</h1>
</head>
<body>
...
</body>
</html>

How To Fix

Ensure the <head> element only uses valid elements as per HTML specifications to ensure critical tags are seen by search engines.

Common invalid elements include <img> and <iframe> elements.

Google strongly recommend against including them in the <head>, but if you must, place these invalid elements after the ones you want Google to see.

Back to top