Skip to main content

WCAG 4.1.1 — Parsing — HTML has duplicate IDs or invalid nesting

moderateWCAG 4.1.1 · Level Acms scope

Your website's HTML code has structural errors like duplicate IDs or improperly nested tags. These coding mistakes prevent screen readers and other assistive technologies from properly interpreting your content, creating barriers for disabled users under ADA Title II requirements.

Who Is Affected

Users of screen readers, voice control software, browser extensions for accessibility, and other assistive technologies that rely on properly structured HTML code to function correctly.

What This Means

HTML parsing errors occur when your website's underlying code violates the basic rules of HTML markup. The most common issues are:

  • Duplicate IDs — Multiple elements with the same ID attribute (IDs must be unique on each page)
  • Invalid nesting — Tags placed inside other tags where they don't belong (like putting a <div> inside a <p>)
  • Unclosed tags — HTML elements that are opened but never closed
  • Missing required attributes — Elements that need certain attributes to be valid

While these errors might not be visible to sighted users, they can cause assistive technologies to malfunction, skip content, or provide incorrect information about the page structure.

Fix: CMS / Theme

Most parsing errors originate in your theme's template files or are generated by plugins/modules that output invalid HTML.

Joomla

  1. Check template overrides in /templates/your-template/html/ for invalid nesting
  2. Review module positions — ensure modules aren't generating duplicate IDs
  3. Test third-party extensions by temporarily disabling them to isolate problematic code
  4. Update to latest Joomla version — newer releases fix many parsing issues

WordPress

  1. Switch to a default theme temporarily to test if the issue persists
  2. Deactivate plugins one by one to identify those generating invalid HTML
  3. Check theme's functions.php for code that might output duplicate IDs
  4. Review custom post type templates for proper HTML structure

Both Platforms

  1. Use the W3C Markup Validator to test your homepage and key landing pages
  2. Fix template-level issues that affect multiple pages simultaneously
  3. Ensure any custom HTML added to theme files follows proper nesting rules

Fix: Content Editor

Some parsing errors are introduced through the content management interface:

  1. Switch to HTML/Code view in your editor to examine the raw markup
  2. Look for duplicate ID attributes — search for id=" and ensure each ID appears only once per page
  3. Check for improperly nested elements:
    • Don't put block elements like <div> inside <p> tags
    • Ensure lists (<ul>, <ol>) only contain <li> elements as direct children
    • Verify heading tags follow proper hierarchy (<h1>, then <h2>, etc.)
  4. Remove any unclosed tags — every opening tag needs a corresponding closing tag
  5. Validate custom HTML snippets before adding them to content

Common Content Editor Mistakes:

  • Copying and pasting from Word documents (often introduces invalid markup)
  • Manually typing HTML without proper closing tags
  • Using the visual editor's formatting tools excessively, which can create nested tags

Standard Reference

WCAG 2.1 Success Criterion 4.1.1 — Parsing, Level A

In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features.

Check if your government website has this issue

OctoComply scans your website and documents for WCAG 2.1 AA violations. The free tier covers up to 10 pages.

Run a Free Scan