One main landmark per page, and what happens without
A page with no main landmark, or with two, breaks the jump-to-content shortcut screen reader users rely on. squirrel counts them.
What the main landmark is
<main> marks the primary content of a page, the part that is not header, navigation, sidebar or footer. Screen readers offer a shortcut straight to it, which is how a user skips the same navigation on every page without a skip link.
Exactly one per page is the rule. Zero means the shortcut has nowhere to go. Two means the user has to guess which one holds the content they came for.
What squirrel checks
One check, landmark-one-main, at rule severity warning. It counts every <main> element and every element with role="main".
- Warn with
Page has no main landmarkwhen the count is zero, expectingOne <main> element or role='main'. - Pass with
Page has exactly one main landmarkwhen the count is one. - Fail with
Page has N main landmarks (should be 1)when the count is above one. Each is listed by its own tag, astag#id,tag.classor a bare tag name, so a<div role="main">appears asdiv#content. The finding carries the issueMultiple main landmarks confuse navigation.
Having none is a warning while having several is a failure. That is deliberate: a missing landmark degrades navigation, while duplicated ones actively mislead.
How to fix it
<header>...</header>
<nav aria-label="Primary">...</nav>
<main>
<h1>Pricing</h1>
...
</main>
<footer>...</footer>Wrap the page’s own content, and only that, in a single <main>. Headers, navigation and footers stay outside it.
Two main landmarks usually means a layout component renders one and a page component renders another. Decide which layer owns it, and take it out of the other.
| Rule ID | a11y/landmark-one-main |
| Category | Accessibility |
| Scope | Per-page |
| Severity | warning |
| Weight | 5/10 |
Enable / disable
Disable this rule
[rules]
disable = ["a11y/landmark-one-main"]Disable all Accessibility rules
[rules]
disable = ["a11y/*"]Enable only this rule
[rules]
enable = ["a11y/landmark-one-main"]enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.
Related rules
- a11y/landmark-regions: the wider sweep across
main,navandfooter. - a11y/skip-link: the bypass check, which accepts
<main>only alongside a<nav>landmark or an early heading. - a11y/heading-order: heading levels that skip, the other structure screen readers navigate by.
- a11y/aria-required-parent: roles such as
listitemandtabthat need a particular container role above them.
Accessibility findings ship in every audit next to the SEO, performance and agent experience rules. See Website security scan with AI for how an agent works through a report.
References
- The main element, MDN
- Landmark regions, WAI-ARIA Authoring Practices
- Page regions, W3C WAI tutorials
Check your site
Run squirrel audit https://example.com and open the Accessibility section of the report. A missing landmark warns, duplicated landmarks fail and are listed individually. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.