How to fix landmark main is top level on Adobe Commerce (Magento)

Move the `<main>` element (or `role="main"`) so it is a direct child of `<body>`, not nested inside any other landmark element such as `<header>`, `<nav>`, `<aside>`, or `<footer>`.

Steps for Adobe Commerce (Magento)

  1. Locate your active theme directory: app/design/frontend/<Vendor>/<theme>/
  2. Open Magento_Theme/templates/root.phtml (or the equivalent layout handle file) to inspect the top-level HTML shell.
  3. Search for `<main` or `role="main"` across your theme's template files (use grep: `grep -r 'role="main"' app/design/frontend/<Vendor>/<theme>/`).
  4. If the `<main>` element or `role="main"` div is nested inside a `<header>` block or another landmark element, edit the template to move it outside — it should sit between the closing `</header>` and opening `<footer>` as a direct child of `<body>`.
  5. Run `bin/magento cache:flush` and `bin/magento setup:static-content:deploy` after saving.
  6. Validate the fix with axe DevTools or WAVE on a frontend page.
Official Adobe Commerce (Magento) documentation ↗

What is landmark main is top level?

Every webpage should have exactly one "main" landmark — the HTML `<main>` tag or any element with `role="main"` — that tells assistive technologies like screen readers "this is where the primary content begins." The WCAG rule `landmark-main-is-top-level` fires when that `<main>` landmark is accidentally placed inside another landmark element (such as `<header>`, `<nav>`, `<section>`, `<aside>`, or `<footer>`) instead of being a direct child of `<body>`. Think of landmarks like a building's floor plan: the "main hall" should open directly off the entrance, not be hidden inside a closet inside a side room.

Screen-reader users rely on landmark navigation to jump straight to the main content, skipping repetitive menus and headers — a fundamental assistive-technology workflow. When `<main>` is buried inside another landmark, screen readers mis-report the page structure, the "skip to content" shortcut may stop working, and keyboard-only users are forced to tab through every navigation item on every page. This directly harms the browsing experience for customers with disabilities and exposes your store to legal risk under laws tied to WCAG 2.1 compliance (ADA in the US, EN 301 549 in the EU, AODA in Canada, and equivalents worldwide). Fixing it is also a positive signal for Google's accessibility-aware ranking considerations and demonstrates a technically well-structured page to crawlers.

See the complete Landmark main is top level guide for every platform and the full background.

Not sure if your Adobe Commerce (Magento) store has this?

Run a free SEOLZ scan — we’ll find landmark main is top level and every other issue across your whole site.

Scan my site free

Fix landmark main is top level on another platform