squirrelscan
GitHub

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 landmark when the count is zero, expecting One <main> element or role='main'.
  • Pass with Page has exactly one main landmark when 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, as tag#id, tag.class or a bare tag name, so a <div role="main"> appears as div#content. The finding carries the issue Multiple 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 IDa11y/landmark-one-main
CategoryAccessibility
ScopePer-page
Severitywarning
Weight5/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.

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

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.

Type to search…

↑↓ navigate↵ openesc close