Validation: <body> Element Preceding <html>

back to issues overview

<body> Element Preceding <html>

Pages that have a body element (such as a <div>, <p> or <img> etc) preceding the opening <html> element.

Browsers and Googlebot will automatically assume the start of the <body> and generate an empty <head> element before it. This means the intended <head> element below and its metadata will be seen in the <body> and ignored.

How to Analyse in the SEO Spider

View URLs with this issue in the ‘Validation’ tab and ‘<body> Element Preceding <html>’ 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 have a <body> element that precedes the opening <html> element.


<!DOCTYPE html>
<div id="whoops">

How To Fix

Ensure <body> elements do not precede the <html> element and they are only in the <body> element.

Further Reading

Back to top