Document does not have a main landmark

How to fix the landmark-one-main accessibility rule. Headings and landmarks. A best practice, not a WCAG requirement.

The message you saw

Lighthouse and PageSpeed Insights
Document does not have a main landmark.
axe-core wording
Document should have one main landmark
axe-core, axe DevTools and this checker
Document should have one main landmark (rule landmark-one-main)

Lighthouse runs axe-core inside it, so both are the same check, and the fix below works whichever tool showed you the message.

What it means

The main landmark marks where the page’s own content is, separate from the header, menu and footer that repeat on every page. You create it with a <main> element (or role="main" on another element). This message means the page has none that screen readers can reach.

Pages built with older templates or page builders often use <div id="content"> for this, which looks the same but means nothing to assistive technology. A <main> hidden with display: none or aria-hidden doesn’t count. If a modal dialog is open when the page is checked, axe skips this rule.

Who is affected

The page has no main landmark, so screen-reader users can't jump straight to the content.

Screen-reader users have a shortcut to jump straight to the main landmark, past the header and menu. Without one they have to find the start of the content by listening or searching.

This is a best practice, not a WCAG requirement on its own. A <main> is also one of the ways to meet 2.4.1 Bypass Blocks.

How to find it

  1. Run the checker: this rule is reported once for the whole page.
  2. In Chrome DevTools, search the Elements panel for <main and role="main".

How to fix it

  1. Find the element that holds the page’s own content (often <div id="content"> or <div class="page">).
  2. Change it to <main>, keeping its id and classes so the styles still apply.
  3. Make sure the header, menu and footer are outside it.
  4. Use only one visible <main> per page.

Example

Before

<div class="header">…</div>
<div id="content">…</div>
<div class="footer">…</div>

After

<header>…</header>
<main id="content">…</main>
<footer>…</footer>

Common mistakes

WCAG success criteria

None. This is a best practice: fixing it helps people using assistive technology, but it doesn’t affect WCAG conformance. Our scanner only reports it if you tick “Also show best-practice suggestions”.

Check your fix

Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools. Scan again after your change: when the rule no longer appears under the problems, the fix worked.

An automated pass means this rule found nothing wrong. It doesn’t prove the page is accessible: some of what WCAG asks for needs a person to check, and the report’s manual checklist lists those steps.

Related fix guides

More detail