Fix label in Shopify Liquid
Shopify footer newsletter signups, discount code inputs, and custom contact sections frequently rely on placeholder='Enter your email' with no associated <label>. Binding <label for='NewsletterForm--{{ section.id }}'> to a matching id fixes the violation while avoiding duplicate IDs when multiple sections appear on the same page.
Before and after
{%- comment -%} sections/footer.liquid (Broken: placeholder-only newsletter input) {%- endcomment -%}
{%- form 'customer', class: 'footer__newsletter' -%}
<input
type="email"
name="contact[email]"
placeholder="Enter your email"
required
>
<button type="submit">Subscribe</button>
{%- endform -%}{%- comment -%} sections/footer.liquid (Fixed: section-scoped <label for> binding) {%- endcomment -%}
{%- form 'customer', class: 'footer__newsletter' -%}
<div class="field">
<label for="NewsletterEmail-{{ section.id }}" class="field__label">
{{ 'newsletter.label' | t | default: 'Email address' }}
</label>
<input
id="NewsletterEmail-{{ section.id }}"
type="email"
name="contact[email]"
autocomplete="email"
placeholder="alex@example.com"
required
>
</div>
<button type="submit">{{ 'newsletter.button_label' | t | default: 'Subscribe' }}</button>
{%- endform -%}Fixed vs. broken example
Click directly on the "Work email address" label in the fixed preview: native browsers expand the hit target and immediately move focus into the input.
Playwright + axe-core check
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("Shopify footer newsletter and search inputs pass axe-core label", async ({ page }) => {
await page.goto("/");
await expect(page.getByLabel(/email/i)).toBeVisible();
const results = await new AxeBuilder({ page })
.withRules(["label"])
.analyze();
expect(results.violations).toEqual([]);
});Template deduplication tip
An unlabeled email input inside sections/footer.liquid fires on every single page of your Shopify store. A11yDrift merges all of those footer alerts into one global layout cluster—fix sections/footer.liquid once to clear 100% of routes.
What NVDA and VoiceOver announce
Placeholder-only inputs lose their hint the moment a user starts typing, cannot be focused by clicking a visible label target, and leave screen-reader and cognitive-disability users guessing which data belongs in each field during checkout or signup.
NVDA (Windows)
"edit, has auto complete, blank" (no field purpose announced)
"Work email address, edit, has auto complete, blank"
VoiceOver (macOS / iOS)
"edit text, Work email address" (inconsistent placeholder fallback that disappears once filled)
"Work email address, edit text"
Common questions
Why use {{ section.id }} in Shopify Liquid input IDs?
Why isn't placeholder='Email' enough to pass WCAG 1.3.1 & 3.3.2?
Can I visually hide a Shopify search input's label if a magnifying glass icon is beside it?
Test a URL for label
Enter any public URL for a free WCAG 2.2 AA check—no account or credit card required.
Managing Shopify Liquid client sites? Monitor 15 sites on one flat plan with white-label portals and branded executive PDFs—$1,140/yr ($95/mo billed annually, 24-month rate lock + onboarding) for Founding 10 agencies.