How to fix landmark one main on Headless / Custom (I build in code)
Add a single `<main>` landmark element (or `role="main"`) to every page so assistive technologies can identify and navigate directly to the primary content.
Steps for Headless / Custom (I build in code)
- In your root layout component or HTML shell (e.g. `_app.jsx`, `layout.tsx`, `default.html`), find the `<div>` wrapping your page-level content output.
- Replace that `<div>` with a `<main>` element (e.g. `<main id="main-content">`) or add `role="main"` if you must keep a `<div>` for styling reasons.
- Ensure only one `<main>` renders per page — if you have nested layout components, trace the full render tree to confirm no duplicates.
- Add a skip link in the topmost component: `<a href="#main-content" class="skip-link">Skip to main content</a>` pointing at the `id` on your `<main>`.
- Run `axe-core` in your CI pipeline (e.g. via `jest-axe` or Playwright/axe) to catch regressions automatically.
What is landmark one main?
Every web page should have exactly one "main" landmark — a special HTML tag (`<main>`) or ARIA role (`role="main"`) that marks the start of the primary content on the page. Think of it like a "skip to content" anchor that is built directly into the page structure. Screen readers and other assistive technologies use landmarks to let users jump between sections (navigation, header, main content, footer) without having to listen to everything in order. The `landmark-one-main` rule specifically checks that your page has one — and only one — such marker.
Without a main landmark, people who use screen readers (blind users, users with motor disabilities who rely on keyboard or switch navigation) must tab through every link, menu item, and banner on your page before they reach any product or content — on every single page load. This is a major usability barrier that can expose your store to accessibility lawsuits under the ADA (US), AODA (Canada), EAA (EU), and similar regulations that require conformance with WCAG 2.1. Fixing it is also a WCAG 2.1 Success Criterion 1.3.6 and 2.4.1 compliance item. Additionally, Google's crawlers and structured-data systems recognise landmark regions, so clear page structure can indirectly support crawl efficiency and rich-result eligibility.
See the complete Landmark one main guide for every platform and the full background.
Not sure if your Headless / Custom (I build in code) store has this?
Run a free SEOLZ scan — we’ll find landmark one main and every other issue across your whole site.
Scan my site free