AMP · AMP page

AMP page missing the body element

This AMP page has no body start or end tags. Browsers add a body anyway, but AMP requires the element in the source, so the page fails validation.

How this page is built

This page is an AMP page. Its canonical points at a non-AMP version, which names this page in a rel=amphtml link. The source has no <body> or </body> tags. Browsers create a body element on their own, so the page still displays. Everything else on the page is valid AMP.

Why it matters

HTML lets authors leave out the body tags, and browsers add the element when they parse the page. AMP is stricter: the body tags must be in the source. Without them the page fails validation and is not served as AMP.

Missing tags usually point to a template error, such as a partial that was meant to open the body.

How to check it

Run the page through the AMP validator (the AMP Test in Search Console, the validator at validator.ampproject.org or the amphtml-validator package), or add #development=1 to the URL and open the browser console. Crawl tools that check AMP report validation errors per page. You can also view the source and search for <body.

How to fix it

Add the opening and closing body tags around the page content in the AMP template. Google stopped requiring AMP for Top Stories in 2021, so many sites no longer need AMP at all.

Back to all tests