H1 heading is empty
What is this issue?
The page has an <h1> with nothing in it — no text, and no image with alt text.
Common causes:
- a template slot the CMS never filled (
<h1>{{ page.heading }}</h1>with no heading set); - an icon-only or decorative heading;
- a logo heading whose image has no
alt.
An H1 that contains only an image with alt text is fine: the alt is its text.
A page with no H1 at all is a different finding, "Page has no H1 heading", and the two are never reported together.
Why it matters
The page states no topic. The H1 is where a page says what it is about, and an empty one says nothing — to search engines or to readers.
Screen readers announce it anyway. An empty heading is still in the document outline, so assistive technology reads out "heading level 1" followed by nothing, at the very point the user expects the page's subject.
It usually means missing content. An empty heading is often the visible symptom of a template field nobody filled in, and the same page may be missing other content the template expected.
How to fix it
If the heading should have text, fill it — usually by setting the page's heading field in the CMS, or fixing the template variable.
<!-- Before --> <h1></h1> <!-- After --> <h1>Running shoes</h1>If it is a logo or image heading, give the image alt text naming what it shows.
<h1><img src="/logo.svg" alt="Acme running shoes" /></h1>If the element is decorative or a layout leftover, remove it, or change it to a non-heading element.
Examples
Example 1: A text heading
<h1>Running shoes</h1>Passes.
Example 2: A logo heading with alt text
<h1><img src="/logo.svg" alt="Acme" /></h1>Passes. The alt text is the heading's text.
Example 3: An unfilled template slot
<h1></h1>Fails. Whitespace or alone fails the same way.
Example 4: An image without alt
<h1><img src="/logo.svg" /></h1>Fails. There is nothing for a reader or search engine to read.
Example 5: One real H1 and one empty one
<h1>Running shoes</h1>
<h1></h1>Fails. One of two H1s is empty. The page is also reported for having more than one H1.
How PixyScan detects this
Every
<h1>is examined.Text is read the way a reader sees it. All text inside the heading, including inside nested elements, with whitespace, non-breaking spaces and zero-width characters removed.
Image alt text counts. If the heading has no text but contains an
<img>with a non-emptyalt, it is not empty.Reported when any H1 is empty. One finding per page, carrying how many H1s the page has and how many are empty — a page with one real H1 and one empty one is reported, because the empty one is still in the outline.
Never with "Page has no H1 heading". That check fires when there are no H1s; this one can only fire when there is at least one.
What we store
Storage Level
Page Level
Database Table / Prisma Model
PageSeoBasicsData (page_seo_basics_data). The finding itself is stored on
audit_issues.details.
Fields Used
| Field | Type | Description |
|---|---|---|
| h1_count | Int? | How many <h1> elements the page has |
| heading_tree | Json? | Every <h1>–<h6> in source order: { tag, text }, text clipped to 200 characters |
| duplicate_elements | Json? | Includes { element: 'h1', value, count } when the page has more than one H1 |
Stored Fields on the finding
| Field | Type | Description |
|---|---|---|
| h1Count | Int | How many H1s the page has |
| emptyH1Count | Int | How many of them are empty |
Detection Dependencies
- HTML Document — every
<h1>, its text and any images inside it