Fix landmark-one-main in WordPress
Older WordPress classic themes and custom page-builder templates often output <div id='content'> instead of <main>, or forget <main> on archive.php, search.php, and 404.php. Updating your template wrapper (or setting the Group block's HTML element to <main> in Full Site Editing templates) resolves every page cleanly.
Before and after
<?php // page.php (Broken classic WordPress template using <div id="primary">) ?>
<?php get_header(); ?>
<div id="primary" class="content-area">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php endwhile; ?>
</div>
<?php get_footer(); ?><?php // page.php (Fixed WordPress template with semantic <main id="primary">) ?>
<?php get_header(); ?>
<main id="primary" class="site-main" tabindex="-1">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php endwhile; ?>
</main>
<?php get_footer(); ?>Fixed vs. broken example
Pair your single <main id="main-content" tabindex="-1"> landmark with a visible-on-focus "Skip to main content" link at the top of <body>.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("WordPress pages and posts expose exactly one <main> landmark", async ({ page }) => {
await page.goto("/about/");
await expect(page.getByRole("main")).toHaveCount(1);
const results = await new AxeBuilder({ page })
.withRules(["landmark-one-main"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
Adding <main id='primary'> across index.php, single.php, page.php, and archive.php (or your FSE template wrapper) eliminates landmark-one-main across thousands of WordPress URLs.
What NVDA and VoiceOver announce
Keyboard and screen-reader users rely on the <main> landmark (and Skip-to-Content links targeting it) to bypass 30+ repeating header, mega-menu, and announcement links on every page navigation.
NVDA (Windows)
Pressing D (next landmark) announces: "no next landmark"
Pressing D jumps straight past navigation and announces: "main landmark"
VoiceOver (macOS / iOS)
Landmarks rotor shows no Main region; user must step through every header link.
Landmarks rotor lists "main", letting the user jump directly to primary content.
Common questions
How do I set a <main> landmark in a WordPress Block Theme (FSE)?
Where should the WordPress Skip-to-Content link live?
<a class='skip-link screen-reader-text' href='#primary'>Skip to content</a> immediately after wp_body_open() inside header.php so it is the very first Tab stop on every page.Should a WordPress sidebar (<aside>) sit inside or outside <main>?
Test a URL for landmark-one-main
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing WordPress client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.