Right now I have to set all headers in my accordions manually to H3. If I use the HTML tag choice in Accordion -> HTML tag instead, I get errors from Google.
I got help from Claude to translate the issue:
The FAQ accordion component in the theme currently renders its headers as <h3> elements with role="button" applied directly:
html
<h3 id="tab-e430-e265" class="x-acc-header" role="button" type="button"
aria-expanded="false" aria-controls="panel-e430-e265"
data-x-toggle="collapse" data-x-toggleable="e430-e265">
Hvad får man med?
</h3>
This is flagged as an accessibility error (“ARIA role should be appropriate for the element”) because a heading element is being overridden to behave like an interactive control. There are two problems with this pattern:
-
Semantic conflict :
<h3> is a heading element. Overriding it with role="button" strips its native heading semantics for assistive technology and search engine crawlers, while also not giving it the native behavior of a real button (keyboard activation via Space/Enter, focus handling, form-safe type attribute, etc.).
-
Invalid attribute :
type="button" is only a valid attribute on <button> elements. On an <h3> , it does nothing and is itself flagged as invalid markup.
This matters beyond Lighthouse/Google’s audit — it directly affects how screen readers and AI browsing agents parse the page. Both rely on the accessibility tree to identify headings for navigation (“jump to next heading”) and to identify interactive controls for actions (“click this button”). An element that’s neither a proper heading nor a proper button breaks both use cases.