Missing or insufficient page title
document/title-empty
- WCAG success criterion
- 2.4.2 (level A)
- Outcome class
- Automatic. An automated check that can report a confirmed violation.
- Area
- Accessibility, Navigation & Operation
- Default severity
- high
- axe-core rule
document-title
Why we flag this
Screen reader users cannot identify the page.
Empty or generic <title> tag.
What the rule checks
Scope. Top-level HTML documents that have a title element.
Expectation. Fails when the document's title element is empty or contains only whitespace. A title set by script (document.title) before the audit reads the DOM is not empty. Without a title element the rule does not apply (document/title-missing reports that). One finding at the title element.
Source. WCAG 2.2 SC 2.4.2 Page Titled; ACT 2779a5 (HTML page has non-empty title); HTML §4.2.2
Detection: shared; needs dom.
Failing example
The check reports a violation here. Corpus case empty_title. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<main>
<h1>Page with an empty title element</h1>
<p>The title tag above is present but empty.</p>
</main>
</body>
</html>Passing example
The check passes here and reports nothing. Corpus case structure_modal_dynamic. The page may contain further findings for other rules.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style>
body { font: 16px/1.5 sans-serif; margin: 0 16px; }
button { min-width: 44px; min-height: 44px; }
</style>
</head>
<body>
<!-- A consent wall (#783): the application has not rendered yet, and a
script sets the page language and the document title and opens a modal
dialog after load.
While the dialog is open, the page's headings and main landmark are
missing for the moment of measurement, not necessarily for the page. -->
<div id="app"></div>
<dialog id="consent" aria-label="Cookie settings">
<p>We use cookies to remember your shopping basket.</p>
<form method="dialog">
<button value="accept">Accept</button>
<button value="reject">Reject</button>
</form>
</dialog>
<script>
document.documentElement.lang = 'en';
document.title = 'Cookie settings – Acme Hardware';
document.getElementById('consent').showModal();
</script>
</body>
</html>This page is generated from the rule catalogue and the rule contracts; see therule overview for how the outcome classes are derived.