Landmark main is top level

Quick win

Found on 9% of audited stores.

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>`.

What it is

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.

Why it matters

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.

How to fix it

  1. Open your theme's main layout/template file (the one that outputs the full HTML shell — often called theme.liquid, base.html, layout.php, or similar).
  2. Search the file for the `<main>` tag or any element that has `role="main"` on it.
  3. Inspect the HTML hierarchy around it: check whether it is wrapped inside `<header>`, `<nav>`, `<section>`, `<aside>`, `<footer>`, or any other element that carries a landmark role.
  4. If it is nested, cut the entire `<main>…</main>` block out of the surrounding landmark and paste it as a direct sibling of `<body>`'s other top-level children (e.g., directly after the closing `</header>` tag and before the opening `<footer>` tag).
  5. Save and preview the page; use a browser extension (axe DevTools, Lighthouse, or WAVE) to confirm the violation is resolved and that `<main>` now appears as a top-level landmark in the accessibility tree.
  6. Also verify that any 'Skip to main content' link at the top of the page still correctly targets the `<main>` element's `id` attribute.

Fix it on your platform

Pick your platform for the exact steps.

How to fix landmark main is top level on Shopify
  1. In your Shopify Admin, go to Online Store → Themes → click 'Customize' next to your active theme, then exit Customize and instead click the '…' menu → Edit code.
  2. In the Layout folder, open 'theme.liquid' (the master HTML shell for almost every Shopify theme).
  3. Search (Ctrl/Cmd+F) for '<main' or 'role="main"'.
  4. Check what HTML tag directly wraps the `<main>` element. Common culprits: a `<div role='banner'>`, a `<header>`, or a wrapper `<section>`.
  5. Cut the entire `<main>…</main>` block (and its closing tag) and paste it as a direct child of `<body>`, typically right after the closing `</header>` tag.
  6. Click Save, then visit a storefront page and run axe DevTools or WAVE in your browser to confirm the fix.
How to fix landmark main is top level on Shopify Plus
  1. Follow the same steps as Shopify above; Shopify Plus uses the same theme architecture.
  2. If you use a custom Hydrogen (headless) storefront, locate the root layout component (e.g., app/root.jsx or app/components/Layout.jsx) and ensure `<main>` is rendered as a direct child of the document body element, not inside a `<header>` or landmark wrapper component.
How to fix landmark main is top level on WooCommerce
  1. In your WordPress Admin, go to Appearance → Theme File Editor (or use a local editor/FTP).
  2. Open your active theme's 'header.php'. Look for a `<main>`, `<div id='main'>`, or `<div role='main'>` that opens inside the `<header>` tag — this is the most common location of the bug.
  3. If `<main>` opens inside `header.php` but inside a landmark wrapper, move its opening tag to just after the closing `</header>` tag (or to the very top of 'index.php' / page templates before other content).
  4. Check that the matching closing `</main>` tag is in 'footer.php' before the `<footer>` landmark, not inside it.
  5. If you use a page builder (Elementor, Divi, etc.), those tools often inject their own wrappers — install the 'Editorskit' or 'Accessibility Checker' plugin and follow its landmark audit to locate the nesting.
  6. Save, flush any caching plugin, and verify with WAVE or axe in your browser.
How to fix landmark main is top level on BigCommerce
  1. In your BigCommerce Admin, go to Storefront → My Themes → click 'Advanced' → Edit Theme Files (for Stencil themes).
  2. Open 'templates/layout/base.html' — this is the master HTML shell.
  3. Search for `<main` or `role="main"`.
  4. Check if it is wrapped by a `<header>` or other landmark-tagged element. If so, move the `<main>` opening tag to sit directly after the closing `</header>` tag at the top-level of `<body>`.
  5. Ensure the closing `</main>` tag appears before the opening `<footer>` tag.
  6. Push changes, clear the CDN cache, and validate with an axe browser extension.
How to fix landmark main is top level on Wix
  1. Wix generates HTML automatically from its editor layout; you cannot directly edit the raw HTML output.
  2. Open the Wix Editor and inspect which section or strip contains your primary page content.
  3. Ensure no 'Header' or 'Footer' section in the Wix Editor visually or logically wraps the page body content — Wix maps these to landmark regions internally.
  4. Use the Wix Accessibility Wizard (Add → Accessibility → Accessibility Wizard) to check for landmark issues it can detect and auto-fix.
  5. For persistent issues, contact Wix Support and reference WCAG 2.1 Success Criterion 1.3.6 / landmark structure, as the underlying HTML is platform-controlled.
  6. If you use Wix Velo (developer mode), you can add `role` attributes to custom-coded sections to avoid conflicting landmarks, but the core `<main>` placement remains platform-managed.
How to fix landmark main is top level on Wix Studio
  1. Wix Studio also generates its landmark HTML automatically. Open the Studio Editor and verify that content sections are correctly categorized as body content (not placed inside the Header or Footer panels).
  2. Use the built-in Accessibility panel (available under the site settings / SEO & Accessibility tab) to review landmark warnings.
  3. For custom-coded widgets or sections using Velo, ensure you do not apply `role='banner'`, `role='navigation'`, or other landmark roles to containers that wrap your main content block.
  4. Escalate persistent issues to Wix Studio support referencing the specific WCAG landmark nesting requirement.
How to fix landmark main is top level on Squarespace
  1. Squarespace controls its own HTML landmark structure; you cannot directly reorder `<main>` vs. `<header>` through the visual editor.
  2. Go to Pages → select a page → click Edit, and ensure your main content sections/blocks are not placed inside a Header or Footer content area.
  3. Navigate to Website → Pages → Website Tools → Custom CSS or inject code via Settings → Advanced → Code Injection: add a diagnostic script only (you cannot rewrite landmark tags via CSS injection).
  4. If the violation originates from a Squarespace template bug (some older templates wrap content inside header regions), switch to a newer Fluid Engine template, which has improved semantic structure.
  5. For code blocks, avoid adding `role` attributes that could create extra landmarks wrapping your content.
  6. Report persistent template-level violations to Squarespace support, referencing the landmark-main-is-top-level WCAG rule.
How to fix landmark main is top level on Webflow
  1. In the Webflow Designer, open the page or the site's global layout.
  2. In the Navigator panel (left sidebar), find the element that has the 'Main' tag or has 'role=main' set — typically a Section or Div element labeled 'Main Wrapper' or similar.
  3. Check its parent element in the Navigator. If the parent is a 'Header' element, a Nav, or any other landmark-tagged container, drag the Main element out so it is a direct child of the Body node in the Navigator.
  4. To set or verify the HTML tag: select the element → go to Element Settings (D key) → HTML Tag → choose 'main'.
  5. Ensure the Header and Footer elements are siblings of Main, not parents.
  6. Publish the site and verify with axe DevTools or WAVE in your browser.
How to fix landmark main is top level on 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.
How to fix landmark main is top level on Magento Open Source
  1. Follow the same steps as Adobe Commerce (Magento) above — the theme file structure is identical.
  2. If you are using a third-party theme (e.g., Hyvä), check the theme's main layout template (typically resources/views/layouts/default.phtml or similar) and apply the same landmark reordering logic.
How to fix landmark main is top level on Headless / Custom (I build in code)
  1. In your root layout component or base HTML template, locate the element rendered as `<main>` or carrying `role='main'`.
  2. Ensure it is a direct child of `<body>` in the rendered DOM — confirm with browser DevTools (Elements tab → inspect the full DOM tree).
  3. Restructure your component tree so that Header, Nav, and Footer components are siblings of Main, not ancestors.
  4. Run `npx axe-core` or integrate axe-core into your CI pipeline to catch regressions automatically.
  5. Use the Accessibility Tree view in Chrome DevTools (Accessibility tab) to verify `<main>` appears as a top-level landmark with no landmark parent.

Does your site have this issue?

Run a free SEOLZ scan to find landmark main is top level — and every other issue — across your whole site in minutes.

Scan my site free

Frequently asked questions

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.

Why does landmark main is top level matter?

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.

How do I fix landmark main is top level?

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>`.

Authoritative references

Related Accessibility (WCAG) issues