Recommended practice Priority: Moderate
The page has more than one main content area
Two or more parts of the page are marked as the main content. There should be only one. This is a recommended practice that goes beyond the WCAG 2.2 AA level the law relies on.
This text was translated automatically and has not been reviewed by a native speaker yet.
Why it matters to your customers
Screen reader users jump between page areas (header, menu, main content, footer) like chapters. When they jump to "main content", they may land on a banner or a widget instead of the product page or the cart, and have to search again.
Who is affected
- blind people using screen readers
- keyboard users relying on a "skip to content" link
- people with low vision using screen magnifiers with speech
How to fix it
Leave a single <main> element (or role="main") that wraps the real page content. Replace the extra <main> or role="main" in nested templates, sections and embedded widgets with <div> or <section>. Check pop-ups, quick-view windows and mega menus too, since they are often built from a copy of the page template.
On Shopify
Usually the theme's layout/theme.liquid already contains <main>, and a section or app block adds another one. Change the extra <main> in the section file or ask the app developer to remove it.
On Shoptet (CZ)
Usually comes from custom HTML added to a page or from the template. Check your own added code first; if it is in the template, report it to Shoptet or a partner.
On PrestaShop
Usually the theme's layout .tpl and a module template both output <main>. Edit the module template override in the theme so only the layout has <main>.
On WooCommerce
Usually the theme wraps content in <main> and a page builder or a WooCommerce template override adds a second one. Fix it in the child theme's template or switch the builder's container tag to div.
Standards
Not a WCAG success criterion: a recommended practice that makes the site easier to use.
Automated check: axe-core rule landmark-no-duplicate-main.
dequeuniversity.com, github.com, www.w3.org