How to fix empty heading on Adobe Commerce (Magento)

Find every empty heading tag on your store and add visible, descriptive text (or remove the tag entirely) so screen readers and search engines can interpret your page structure.

Steps for Adobe Commerce (Magento)

  1. Connect to your server via SSH or SFTP and navigate to your active theme directory: `app/design/frontend/<Vendor>/<Theme>/`.
  2. Search template `.phtml` files for empty heading tags: `grep -rn '<h[1-6][^>]*></h[1-6]>' .`
  3. Open the relevant `.phtml` file and add a text string or a PHP variable (e.g. `<h2><?= $block->escapeHtml($block->getTitle()) ?></h2>`).
  4. Wrap dynamic headings in a conditional to prevent rendering when the value is empty: `<?php if ($block->getTitle()): ?><h2><?= $block->escapeHtml($block->getTitle()) ?></h2><?php endif; ?>`
  5. For CMS Pages/Blocks (Admin → Content → Pages or Blocks): open the page, switch to HTML source mode in the WYSIWYG editor, locate empty `<h*></h*>` tags, and add text or remove them.
  6. Clear the Magento cache (System → Cache Management → Flush Magento Cache) and verify with the axe DevTools browser extension.
Official Adobe Commerce (Magento) documentation ↗

What is empty heading?

A heading tag — `<h1>`, `<h2>`, `<h3>`, and so on — is supposed to label a section of a page, like a chapter title in a book. An "empty heading" is one of those tags that exists in your page's code but contains no readable text: it might be completely blank, hold only a spacer character, or contain an icon with no text alternative. Because the tag is there but says nothing, screen readers announce "heading" to a blind or low-vision visitor and then go silent — which is confusing and often disorienting.

Accessibility & legal risk: WCAG 2.1 Success Criterion 1.3.1 (Info and Relationships) and 2.4.6 (Headings and Labels) require headings to be meaningful. Empty headings fail these criteria, exposing your store to accessibility complaints, ADA/AODA/EAA legal action, and — in many jurisdictions — potential litigation. *SEO:* Search engines use heading tags as strong signals for what a page is about. Empty headings dilute the heading hierarchy and give crawlers nothing useful, which can hurt rankings for the sections those headings are meant to introduce. *Conversions:* A broken page structure frustrates assistive-technology users, who represent roughly 15–20 % of the global population, and causes them to abandon your store.

See the complete Empty heading guide for every platform and the full background.

Not sure if your Adobe Commerce (Magento) store has this?

Run a free SEOLZ scan — we’ll find empty heading and every other issue across your whole site.

Scan my site free

Fix empty heading on another platform