How to Find Empty H1 Tags with CLI
Learn how to detect pages with empty H1 tags using crawler.sh CLI. Find headings that contain no text and fix them to improve SEO and page structure.
An empty H1 tag - one that exists in the HTML but contains no text - is worse than having no H1 at all. It tells search engines that the page has a primary heading, but provides no information about the page topic. Empty H1 tags typically result from template errors, CSS-only headings, or image-based headings without alt text.
This guide shows you how to find every page with an empty H1 tag using the crawler.sh CLI.
Step 1: Install crawler.sh CLI
Install the CLI with a single command:
curl -fsSL https://install.crawler.sh | shThis downloads the correct binary for your operating system and architecture, places it in ~/.crawler/bin/, and adds it to your PATH. Restart your terminal or run source ~/.bashrc (or ~/.zshrc) to pick up the new PATH entry.
Verify the installation:
crawler --versionStep 2: Crawl the target website
Run a full crawl of the website you want to audit:
crawler crawl https://example.comThe crawler extracts H1 tag content from every page. Results are saved as an NDJSON file (.crawl) in the current directory. For larger sites:
crawler crawl https://example.com --max-pages 5000Step 3: Run SEO audit
Run the SEO analysis on your crawl data:
crawler seo example-com.crawlThe empty H1 check flags every page where an <h1> element exists but contains no visible text.
Step 4: Identify empty H1 tags
Look for the Empty H1 section in the SEO report. Common causes of empty H1 tags:
- H1 tags containing only an image with no alt text (
<h1><img src="..."></h1>) - H1 tags with text set to
display: noneorvisibility: hiddenvia CSS - Template placeholders that were never filled in
- H1 tags with only whitespace or HTML entities
- JavaScript-dependent headings that are empty in the initial HTML
Step 5: Fix and re-crawl
For each page with an empty H1:
- Add descriptive text to the H1 that summarizes the page’s main topic
- Add alt text if the H1 wraps an image - or better, use text with CSS for styling
- Remove empty H1 tags entirely if the page has another proper H1
- Fix template logic that creates empty heading elements
After fixing, re-crawl to verify:
crawler crawl https://example.comcrawler seo example-com.crawlWhy empty H1 tags matter for SEO
Search engines parse the H1 tag for topic signals. An empty H1 provides a contradictory signal - the page declares a primary heading but provides no content for it. This can confuse search engine algorithms and represents a missed opportunity to reinforce your page’s target keywords. Filling in empty H1 tags is a quick fix that strengthens both your SEO and your page’s accessibility for screen reader users.