Shopify Liquid fix

Before and after

Broken — before
{%- comment -%} sections/featured-collection.liquid (Broken: skips h2 & h3 straight to h4) {%- endcomment -%}
<section class="featured-collection">
  <h1>{{ section.settings.title | escape }}</h1>
  <div class="grid">
    {%- for product in section.settings.collection.products limit: 4 -%}
      <article class="card">
        <h4>{{ product.title | escape }}</h4>
      </article>
    {%- endfor -%}
  </div>
</section>
Fixed — after
{%- comment -%} sections/featured-collection.liquid (Fixed: sequential h2 -> h3 + visual .h4 class) {%- endcomment -%}
<section class="featured-collection">
  <h2 class="title h1">{{ section.settings.title | escape }}</h2>
  <div class="grid">
    {%- for product in section.settings.collection.products limit: 4 -%}
      <article class="card">
        <h3 class="card__heading h4">
          <a href="{{ product.url }}" class="full-unstyled-link">
            {{ product.title | escape }}
          </a>
        </h3>
      </article>
    {%- endfor -%}
  </div>
</section>
Live preview

Fixed vs. broken example

Passes heading-order
Accessibility tree: Sequential outline: heading level 1 -> heading level 2 (clean hierarchy)

Decouple visual typography from semantic heading depth: choose <h1>–<h6> strictly for document outline nesting and apply CSS utility classes for font size.

Automated test

Playwright + axe-core check

tests/a11y-heading-order.spec.ts
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";

test("Shopify homepage and collection pages follow sequential heading-order", async ({ page }) => {
  await page.goto("/collections/all");
  const results = await new AxeBuilder({ page })
    .withRules(["heading-order"])
    .analyze();
  expect(results.violations).toEqual([]);
});

Template deduplication tip

A footer column heading rendered as <h5> in sections/footer.liquid or product card titles jumping from <h1> to <h4> in snippets/card-product.liquid fire on every page. Fixing that one Liquid partial clears the entire store.

Screen readers

What NVDA and VoiceOver announce

Over 67% of screen-reader users navigate long pages primarily by jumping between headings (H / 1–6 keys). Skipping from <h1> straight to <h4> for visual sizing breaks the mental document outline and makes sub-sections appear orphaned.

NVDA (Windows)

Broken

"Accessibility Audit Report, heading level 1" -> "Key Template Clusters, heading level 4" (user suspects missed sections 2 & 3)


Fixed

"Accessibility Audit Report, heading level 1" -> "Key Template Clusters, heading level 2"

VoiceOver (macOS / iOS)

Broken

"heading level 1, Accessibility Audit Report" -> "heading level 4, Key Template Clusters"


Fixed

"heading level 1, Accessibility Audit Report" -> "heading level 2, Key Template Clusters"

Common questions

Should my Shopify store logo in sections/header.liquid be an <h1>?
Only on the homepage if there is no hero <h1>; on product, collection, and article pages, render the logo as a <span> or <a> so the product or collection title is the single primary <h1>.
What heading level should Shopify footer columns use?
Use <h2> styled with a smaller CSS class (e.g., <h2 class='footer-block__heading h5'>) so footer sections sit cleanly under the document <h1> without skipping levels when a page only has <h1> and <h2> headings.
How does Dawn's heading_size schema setting avoid heading-order bugs?
Dawn exposes a CSS class selector (h0, h1, h2) separately from the HTML tag (<h2>), allowing merchants to change visual size without breaking semantic heading hierarchy.