How to Fix List Structure Errors in HTML (ul, ol, dl)
Screen readers announce lists as "list, 5 items" only when the HTML is built correctly. Common failures include a <div> or <a> placed directly inside a <ul>, an <li> with no list parent, or a <dl> containing loose <p> tags. By the end of this guide you will have found every malformed list, fixed the markup or ARIA roles, and confirmed that the four related checks pass: list, listitem, definition-list and dlitem.

Why it matters
Assistive technology uses list semantics to tell users how many items a group holds and to let them skip past it. Broken lists in navigation menus, product features or FAQ blocks may be read as one run-on string or as unrelated fragments, which makes the page harder to scan for keyboard and screen reader users. The SEO impact is small.
Clean list markup does help search engines and AI parsers pull out steps, feature lists and term/definition pairs accurately. 1 Info and Relationships.
What you need
Step-by-step fix
Locate every failing list on the page
Open a flagged URL in Chrome, open DevTools (F12) and go to the axe DevTools tab. Run Scan all of my page, then filter by the rules list, listitem, definition-list and dlitem. Click Highlight on each issue to jump to the element, and note which template or component outputs it.
That is usually the header menu, footer, breadcrumb or a feature grid.
Remove non-li children from ul and ol
A <ul> or <ol> may only have <li>, <script> or <template> as direct children. Move any <div>, <span>, <a>, <p>, heading or <button> inside an <li>, or turn the wrapper itself into the <li>. Comments and whitespace are fine.
<!-- Wrong --> <ul class="features"> <h3>Features</h3> <div class="feature">Free shipping</div> <a href="/returns">30-day returns</a> </ul> <!-- Right --> <h3>Features</h3> <ul class="features"> <li class="feature">Free shipping</li> <li><a href="/returns">30-day returns</a></li> </ul>
Give orphaned li elements a list parent
Every <li> must sit directly inside a <ul>, an <ol>, or an element with role="list". Orphans usually come from a component that renders <li> items into a <div> or <nav>. Either wrap them in a <ul>, or change them to <div> if the content is not really a list.
<!-- Wrong -->
<nav class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
</nav>
<!-- Right -->
<nav class="breadcrumb" aria-label="Breadcrumb">
<ol>
<li><a href="/">Home</a></li>
<li><a href="/blog">Blog</a></li>
</ol>
</nav>Fix ARIA roles that break list semantics
Some roles on a list or its items cause failures:
- role="none" or role="presentation" on a <ul> strips its list role, so every <li> inside becomes an orphan.
- role="navigation" or role="menubar" on a <ul> does the same thing to its items.
- A role on an <li> such as role="button" makes it an invalid child of <ul>.
Put navigation semantics on a wrapping <nav> and let the <ul>/<li> stay plain. If you must use divs, pair role="list" with role="listitem".
<!-- Wrong -->
<ul role="navigation">
<li><a href="/pricing">Pricing</a></li>
</ul>
<!-- Right -->
<nav aria-label="Main">
<ul>
<li><a href="/pricing">Pricing</a></li>
</ul>
</nav>
<!-- Acceptable div-based list -->
<div role="list">
<div role="listitem">Free shipping</div>
</div>Repair definition lists (dl, dt, dd)
A <dl> may only contain <dt> and <dd> groups, optionally each group wrapped in a single <div>, plus <script> or <template>. Every <dt> needs at least one <dd> after it. Every <dt> and <dd> must sit inside a <dl>, either directly or through one of those <div> wrappers.
Move stray headings or paragraphs out of the <dl> or into a <dd>.
<!-- Wrong -->
<dl class="specs">
<p>Specifications</p>
<dt>Weight</dt>
<span>1.2 kg</span>
</dl>
<dd>Orphaned value</dd>
<!-- Right -->
<h3>Specifications</h3>
<dl class="specs">
<div>
<dt>Weight</dt>
<dd>1.2 kg</dd>
</div>
<div>
<dt>Material</dt>
<dd>Recycled aluminium</dd>
</div>
</dl>Fix list markup inside loops and components
In component frameworks the outer <ul> often lives in one file and the items in another, so a wrapper <div> slips in between. Make the item component return the <li> itself. Avoid extra wrappers such as a styled <div> or an animation container around each item.
// Wrong: ProductCard renders <div class="card"> inside <ul>
<ul className="grid">
{products.map(p => <ProductCard key={p.id} product={p} />)}
</ul>
// Right: wrap each card in an <li>
<ul className="grid">
{products.map(p => (
<li key={p.id}>
<ProductCard product={p} />
</li>
))}
</ul>Re-test and confirm the fix
Clear any page or CDN cache, reload the URL and run the axe DevTools scan again. The list, listitem, definition-list and dlitem issues should be gone. Repeat on one URL per template type (home, category, product, article), then re-run the site audit.
npx @axe-core/cli https://example.com --rules list,listitem,definition-list,dlitem
Platform-specific notes
WordPress
Core List blocks and wp_nav_menu() output valid markup. Failures usually come from page builders or custom walkers. Check your Walker_Nav_Menu start_el() for <div> output. In Elementor or Divi icon-list widgets, open the widget in the editor and confirm the HTML in the browser. Some third-party widgets use <ul> with <div> children, and the fix there is to switch widgets or override the template in a child theme.
Shopify
Edit via Online Store > Themes > ... > Edit code. Menus are rendered in sections/header.liquid or snippets such as header-drawer.liquid. Look inside {% for link in linklist.links %} loops for <div> or <a> output directly inside a <ul>. Dawn-based themes are mostly valid, but app-injected blocks (reviews, badges) can add non-li children.
Webflow
Use the List and List Item elements from the Add panel rather than Div Blocks. Collection Lists render div role="list" with div role="listitem" items, which passes. Don't add a custom role attribute to a Collection List Wrapper or Item in Element Settings > Custom attributes, because that breaks it.
Wix
Wix generates most list markup and offers no raw HTML control. Use the Text element's bullet or number list buttons instead of typed dashes. Failures inside Wix apps can't be fixed directly, so report them to Wix or replace the app. In Wix Studio, custom code embeds must follow the HTML rules above.
Next.js / React
Fragments (<>...</>) inside a <ul> are fine because they render nothing. Wrapping items in a <div> or a styled-components wrapper is not fine. Check each item component's root element. eslint-plugin-jsx-a11y can't catch every nesting issue across components, so run @axe-core/react or Playwright with @axe-core/playwright in tests.
Check that it worked
✅ How to verify
- Run axe DevTools on the page and confirm no issues remain for list, listitem, definition-list or dlitem.
- In Chrome DevTools, open Elements > Accessibility pane on the <ul>. It should show role "list", and each child should show role "listitem".
- Turn on a screen reader (VoiceOver: Cmd+F5 on macOS, or NVDA on Windows) and arrow onto the list. It should announce "list, N items".
- Run Lighthouse > Accessibility and confirm the audits for list, list items and definition list elements are under Passed audits.
⚠️ Common mistakes
- Adding role="presentation" to a <ul> to remove bullet styling, which orphans every <li>. Use CSS list-style: none instead.
- Fixing the rendered HTML on one page in the CMS editor while the broken markup actually comes from a shared header or footer template.
- Placing a heading or 'View all' link directly inside a <ul> as a list title. Put it before the list, or inside its own <li>.
- Wrapping <dt>/<dd> pairs in <span>, <section> or several nested <div>s. Only one plain <div> per group is allowed inside a <dl>.
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 freeFAQ
Can I put a div inside a ul?
Not as a direct child. A <ul> or <ol> may only directly contain <li>, <script> and <template>. You can put a <div> inside an <li>, so wrap it or change the <div> into the <li>.
Is a nested list inside an li valid?
Yes. A <ul> or <ol> placed inside an <li> is the correct way to build sub-menus and nested lists. Just make sure the nested list's own children are <li> elements.
Does Safari VoiceOver still drop list semantics with list-style: none?
WebKit removes the list role from <ul>/<ol> styled with list-style: none in some contexts, unless the list is inside a <nav>. If list announcement matters there, add role="list" to the <ul>. This is valid and does not trigger the list checks.
Do broken lists affect SEO rankings?
Not directly; Google does not penalise invalid list nesting. Well-formed <ol>, <ul> and <dl> markup does make it easier for search engines and AI answer tools to extract steps, feature lists and specifications from your content.
How to Fix "Frames Have Titles": Add Iframe Title Attributes
How to Fix Duplicate Element IDs for Accessibility
How to Fix "Zooming Disabled" in the Viewport Meta Tag
How to Fix Invalid ARIA Attributes and Roles on Your Site
How to Fix Positive tabindex Values for Keyboard Users
How to Add a Skip to Content Link for Keyboard Users