Incorrect heading
Screen reader users rely on headings to navigate app content. When elements that do not introduce sections of content are programmatically marked as headings, screen readers announce false structural cues that mislead users and make heading-based navigation unreliable. This rule ensures that only elements genuinely functioning as headings carry the heading trait, and that heading text clearly describes the content that follows.
- Rule Category :
Content Structure - Rule Severity :
Serious - WCAG 2.1 & 2.2 SC :
1.3.1 (A),2.4.6 (AA) - Supported Platforms :
Android,iOS,React Native,Flutter
Success criteria
The rule checks for the following:
- Elements that do not introduce or organize a section of content must not be programmatically marked with the heading trait.
- Headings must be descriptive, clearly indicating the topic or purpose of the content that follows them.
AI-powered testing
BrowserStack provides an AI-powered Issue Detection Agent that analyzes app screenshots and element properties to identify elements that are programmatically marked as headings but do not genuinely function as headings. If an incorrect heading is detected, the agent provides contextual reasoning and an actionable suggestion.
AI-powered results are clearly marked in the report so you can review and apply suggestions as needed.
The Issue Detection Agent performs the following checks:
-
Detects incorrect headings
- Identifies elements that are programmatically marked as headings but do not introduce or organize a section of content. The Issue Detection Agent checks for the following:
- Decorative or promotional text, such as marketing slogans or stat numbers, marked with the heading trait.
- Interactive elements such as buttons, links, or tab-bar icons that are marked as headings.
- Detail or metadata text, such as timestamps or engagement counts, marked as headings.
- Identifies headings where the text does not adequately describe the topic or purpose of the content that follows.
- Identifies elements that are programmatically marked as headings but do not introduce or organize a section of content. The Issue Detection Agent checks for the following:
-
Suggests fixes
- For elements that are not structural headings, explains why the heading trait should be removed.
- For headings that are not descriptive, suggests more suitable heading text.
For more information about the Issue Detection Agent, see Issue Detection Agent.
How to fix
To resolve incorrect heading violations, remove the heading trait from the text element using the appropriate framework attribute:
To fix this violation:
- Remove the heading trait from text elements that should not function as a heading. On Android, this can be done in two ways:
- In layout XML, remove the
android:accessibilityHeading="true"attribute or explicitly set it tofalse. - In code, call
ViewCompat.setAccessibilityHeading(view, false).
- In layout XML, remove the
- Ensure text elements that act as headings are descriptive, clearly indicating the topic or purpose of the content.
To fix this violation:
- Remove the heading trait from text elements that should not function as a heading. To do so on iOS, remove the
UIAccessibilityTraitHeadertrait. - Ensure text elements that act as headings are descriptive, clearly indicating the topic or purpose of the content.
To fix this violation:
- Remove the heading trait from text elements that should not function as a heading. To do so in React Native, remove the
accessibilityRole="header"prop or replace it with the appropriate role. - Ensure text elements that act as headings are descriptive, clearly indicating the topic or purpose of the content.
To fix this violation:
- Remove the heading trait from text elements that should not function as a heading. To do so in Flutter, remove the
Semanticswidget withheader: true, or setheader: false. - Ensure text elements that act as headings are descriptive, clearly indicating the topic or purpose of the content.
Example
The following screenshot shows an incorrect heading violation in an Android app:

Error
- In this example, the text element “Based in Bengaluru · 3d ago” is programmatically marked as a heading, with
isHeading: true. This text is profile detail information about a user. It does not introduce a new section of content. As a result, screen readers announce it as a heading, creating false navigational cues.
Fix
- To fix this violation, ensure the text element is not programmatically marked as a heading:
- In this example, set the Android heading attribute,
android:accessibilityHeadingfor the text element tofalse.
- In this example, set the Android heading attribute,
References
- 1.3.1 Info and Relationships (Level A): WCAG 2.1 · WCAG 2.2
- 2.4.6 Headings and Labels (Level AA): WCAG 2.1 · WCAG 2.2
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!