Document should not have more than one main landmark
How to fix the landmark-no-duplicate-main accessibility rule. Headings and landmarks. A best practice, not a WCAG requirement.
The message you saw
Lighthouse has no audit for this rule, so you’ll only see it from axe-core based tools.
What it means
The page has two or more main landmarks that screen readers can reach: <main> elements, or elements with role="main". There should be one per page, around the page’s own content.
It usually comes from templates nested inside each other (the layout has a <main> and the page template adds another), or a widget that brings its own. A <main> hidden with the hidden attribute, for example the inactive views of a single-page app, isn’t counted.
Who is affected
The page has more than one main landmark, so “jump to main content” can land on the wrong one.
Screen readers’ “jump to main content” goes to the first main landmark. With two, users may land on the wrong one, or find two “main” entries in the landmarks list and not know which is the real one.
This is a best practice, not a WCAG requirement. HTML itself also allows only one visible <main>.
How to find it
- Run the checker: the report outlines one main landmark and lists the others.
- In DevTools, search the Elements panel for
<mainandrole="main".
How to fix it
- Keep the outer
<main>that wraps the whole content area. - Change the inner ones to
<div>,<section>or<article>. - If you have several views and only one shows at a time, hide the others with the
hiddenattribute.
Example
Before
<main class="layout">
<main class="page">…</main>
</main>After
<main class="layout">
<div class="page">…</div>
</main>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
- Document does not have a main landmark
- Main landmark should not be contained in another landmark
- Landmarks should have a unique role or role/label/title (i.e. accessible name) combination
More detail
- Deque University’s reference for landmark-no-duplicate-main (the makers of axe-core, the engine our scanner uses)
- All fix guides