How to Fix a Missing Main Landmark and Unwrapped Content

This check fails when a page has no <main> landmark, has more than one, or leaves visible content outside any landmark region. By the end of this guide every page template will have exactly one <main>, and headers, menus, banners and footers will sit inside their own landmarks.

By Updated ⏱ 20 minutes🎯 Beginner● Medium impactAccessibility
Illustration: Main landmark present fix guide
ACCESSIBILITY · FIX GUIDE Main landmark present IMPACTEFFORT TIME20 minutes LEVELBeginner

Why it matters

Screen reader users jump between landmarks to skip repeated navigation and reach the content they came for. Without a <main> region they must tab or arrow through every menu link on every page, and content outside landmarks can be missed when people navigate by region. The fix also gives search engines and AI crawlers a clear signal about which part of the page is the primary content and which parts are boilerplate.

1 (Bypass Blocks).

✕Before<body><divclass="top">…menu…</div><divid="content">…article…</div><div✓After<body><header>…<nav>…</nav></header><mainid="main">…article…</main><footer>©

What you need

Access to your theme, template or layout files, or a site builder editor
A desktop browser with the axe DevTools extension or Chrome DevTools
A list of your main page templates (home, article, product, category, contact)

Step-by-step fix

1

Find what the page currently exposes

Open the page, then open DevTools (F12). Paste the snippet into the Console. It counts main landmarks and lists the visible top-level elements that are not inside a landmark.

Run it on each template type, because a blog post template often differs from the homepage.

javascript
console.log('main count:', document.querySelectorAll('main:not([hidden]), [role="main"]:not([hidden])').length);
[...document.body.children].filter(el => el.offsetParent !== null && !el.closest('header,nav,main,footer,aside,[role]') && !['SCRIPT','STYLE','NOSCRIPT'].includes(el.tagName)).forEach(el => console.log('outside landmark:', el));
Pro tip: A main count of 0 or 2+ fails the check. Any element logged as 'outside landmark' is a likely cause of the region failure.
2

Wrap the primary content in a single <main>

In your layout template, replace the outer wrapper around the page content (often <div id="content"> or <div class="site-main">) with <main>. Keep the existing id and class so your CSS still applies. There must be exactly one visible <main> per page, and it must not sit inside <header>, <nav>, <aside>, <footer> or <article>.

html
<!-- Before -->
<div id="content" class="site-content">
  <h1>Spring pricing update</h1>
  <p>…</p>
</div>

<!-- After -->
<main id="main" class="site-content">
  <h1>Spring pricing update</h1>
  <p>…</p>
</main>
Pro tip: If your skip link points to #content, either keep id="content" on the <main> or update the link's href so it still works.
3

Remove duplicate main elements

Duplicates usually come from a layout that adds <main> and a page template or plugin block that adds another one, or from a role="main" on an inner div. Keep the outermost one and change the others to <div> or <section>. If you have multiple views in a single-page app, only the active one may be visible; hide the rest with the hidden attribute.

html
<!-- Wrong: nested main -->
<main>
  <div role="main">…</div>
</main>

<!-- Right -->
<main>
  <div class="content-inner">…</div>
</main>
Pro tip: Search your codebase for both `<main` and `role="main"`. The ARIA role counts as a main landmark too.
4

Put the header, navigation and footer in landmarks

Use <header> for the site logo and top bar, <nav> for menus, and <footer> for the bottom area. A <header> or <footer> only becomes a page-level landmark when it is a direct part of the body layout, not nested inside <main>, <article>, <aside>, <nav> or <section>. If you have more than one <nav>, give each a distinct aria-label.

html
<body>
  <a class="skip-link" href="#main">Skip to content</a>
  <header>
    <a href="/"><img src="/logo.svg" alt="Example Co"></a>
    <nav aria-label="Primary">…</nav>
  </header>
  <main id="main">…</main>
  <aside aria-label="Related articles">…</aside>
  <footer>
    <nav aria-label="Footer">…</nav>
    <p>© 2026 Example Co</p>
  </footer>
</body>
Pro tip: Skip links outside landmarks are allowed, so you do not need to wrap them.
5

Wrap stray banners, notices and widgets

Content that is injected at the top or bottom of the body often fails the region rule. Common examples are announcement bars, cookie banners, chat launchers and newsletter pop-ups. Move each one inside an existing landmark, such as an announcement bar inside <header>, or wrap it in its own labelled region.

  • Cookie or consent banner: <section aria-label="Cookie consent">
  • Promo bar: move into <header>
  • Supplementary widgets: <aside aria-label="…">
html
<section aria-label="Cookie consent" class="cookie-banner">
  <p>Example Co uses cookies to …</p>
  <button type="button">Accept</button>
</section>
Pro tip: A <section> is only a landmark when it has an accessible name (aria-label or aria-labelledby). Without one, it does not fix the region failure.
6

Retest every template

Clear any page or CDN cache, then reload each template. Run axe DevTools (Scan all of my page) and confirm there are no issues for 'Document should have one main landmark', 'Document should not have more than one main landmark' or 'All page content should be contained by landmarks'. Rerun the console snippet from step 1 to double-check, then rerun your site audit.

Pro tip: Test with a consent banner showing and with it dismissed. Many region failures only appear before consent is given.

Platform-specific notes

WordPress

In block themes, open Appearance > Editor > Templates, select the Group block that wraps the content, and go to Block settings > Advanced > HTML element. Set it to <main>, and set the header and footer template parts to <header> and <footer>. Check every template, including Single, Page, Archive and 404. In classic themes, edit header.php, footer.php and the page templates in a child theme. Remove extra role="main" attributes added by page builders.

Shopify

Online Store 2.0 themes such as Dawn already include <main id="MainContent" role="main"> in layout/theme.liquid. Failures usually come from a second main inside a section file, or from app-injected banners placed outside it. Go to Online Store > Themes > … > Edit code and check layout/theme.liquid and sections/*.liquid. Move announcement bars into the header group.

Webflow

Select the wrapper element and open the Settings panel (gear icon). Under Tag, choose Main. Use the Header, Nav and Footer tags for the matching elements. Apply this in each page template and CMS template page, or put it in a shared Component so it stays consistent.

Next.js

Put a single <main> in app/layout.tsx around {children}, with <header> and <footer> as siblings. Do not add another <main> in page.tsx or nested layouts. In the Pages Router, put it in the shared Layout component used by _app.tsx.

Wix

Wix renders a main landmark automatically for the page body. Failures usually come from custom embeds or HTML iframes placed in the header or footer areas. In Wix Studio, select an element and set its semantic tag in the Inspector panel under the Accessibility section. Move custom-code banners inside a section that has a tag set.

Check that it worked

✅ How to verify

  • Run the axe DevTools extension on each template and confirm the landmark-one-main, landmark-no-duplicate-main and region rules all pass.
  • In Chrome DevTools > Elements > Accessibility pane, enable 'full-page accessibility tree' and confirm one 'main' node with banner, navigation and contentinfo alongside it.
  • Use a screen reader landmark list to confirm 'main' appears once: press D in NVDA, use VoiceOver Rotor (VO+U) > Landmarks, or press R in JAWS.
  • Run `document.querySelectorAll('main:not([hidden]), [role="main"]').length` in the console and confirm it returns 1.

⚠️ Common mistakes

  • Adding <main> to the layout while the page builder or a block also outputs one, which creates a duplicate main failure.
  • Using <section> without an aria-label for banners. Unnamed sections are not landmarks, so the content still counts as outside a region.
  • Nesting <header> or <footer> inside <main> or <article> and expecting them to act as the site banner or footer landmark.
  • Fixing only the homepage and leaving blog, product, search and 404 templates without a main landmark.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

Can a page have more than one <main> element?

Only one can be visible at a time. Extra <main> elements must carry the hidden attribute, which is useful for single-page apps that swap views. Otherwise, use exactly one per page.

Is role="main" still needed on the <main> element?

No. All current browsers map <main> to the main landmark. role="main" is redundant on <main> but harmless. Never put it on a second element.

What does 'All page content should be contained by landmarks' mean?

Every visible piece of content must sit inside a landmark: header, nav, main, aside, footer, or a labelled section or form. Stray divs at body level, such as cookie banners or promo bars, trigger this warning.

Does adding a main landmark help SEO?

It is not a direct ranking factor. However, it clearly separates primary content from navigation and boilerplate, which helps crawlers and AI systems extract the right text. It also improves accessibility for screen reader users.