HTML Validation Issues (Incomplete Tags, Improper Nesting, Duplicate Attributes and IDs)
WCAG Focus: WCAG 1.3.1 (A), 4.1.2 (A) · (Legacy 4.1.1)
Custom shortcodes, pasted HTML blocks, and theme template edits occasionally leave behind incomplete start and end tags, improperly nested elements (like putting a <div> inside a <p>), or duplicate attributes and IDs. Even though WCAG 2.2 retired 4.1.1 Parsing as a standalone criterion, duplicate IDs and broken tags still directly break 1.3.1 (Info and Relationships) and 4.1.2 (Name, Role, Value).
Why This Pattern Violates WCAG
WCAG 1.3.1 (Level A) and 4.1.2 (Level A) fail whenever duplicate IDs cause labels, error messages (aria-describedby), or skip links to point to the wrong element.
Malformed start/end tags cause browsers and screen readers to build mismatched DOM trees across sections.
Code Comparison
Broken Nesting & Duplicate IDs
<label for="user-email">Work Email</label>
<input id="user-email" type="email">
<!-- Another widget on the same page reuses id="user-email" -->
<input id="user-email" type="email">
Compliant Unique IDs & Clean Tag Nesting
<label for="contact-user-email">Work Email</label>
<input id="contact-user-email" type="email">
<label for="footer-newsletter-email">Newsletter Email</label>
<input id="footer-newsletter-email" type="email">
How to Fix It in WordPress
- Prefix widget and form IDs uniquely so repeated shortcodes never output duplicate id attributes.
- Validate custom HTML blocks and theme templates to catch unclosed tags and invalid element nesting.
Finding This Issue Automatically
Duplicate IDs and stray unclosed tags are nearly impossible to spot visually when multiple WordPress plugins render on the same page. Paired with the FREE HTML Validation companion plugin, the WP ADA Compliance Check plugin flags incomplete start/end tags, improperly nested elements, and duplicate attributes and IDs across your site.
WCAG References & Supporting Materials
WCAG Success Criteria
- Understanding WCAG 1.3.1 Info and Relationships (Level A)
- Understanding WCAG 4.1.2 Name, Role, Value (Level A)
- Understanding WCAG 4.1.1 Parsing (Obsolete and removed in WCAG 2.2) (Level A)
Supporting Documentation & Guides
- W3C Failure F77: Duplicate values of type ID in HTML markup — Explains how duplicate IDs break label associations, ARIA references, and DOM parsing.
Subscribe
Subscribe to receive daily Web Accessibility - Did you know? articles in your inbox.

