Fix guides · Accessibility
How to fix “Form elements do not have associated labels”
Form fields that rely on placeholder text alone are unnamed for screen reader users. How to label newsletter, search and contact fields on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.
- Time to fix
- 15–30 minutes
- Skill needed
- Copy and paste
- Who notices
- Screen reader and voice-control users, and anyone using autofill
Why it matters
A label tells assistive technology what a field is for. Without one, a screen reader announces just "edit text", and a voice-control user can't say "click Email" to reach it.
Placeholder text inside the field isn't a label: it disappears as soon as someone types, and many screen readers don't read it reliably.
Related checks: a field should have only one label, and autocomplete values (like email or postal-code) must be spelled correctly so browsers can fill them in.
“Home pages had 6.9 form inputs on average—a 36% increase in the last 3 years. One third (33.1%) of those form inputs were not properly labeled (either via <label>, aria-label, aria-labelledby, or title).”
Before you start
- Your report lists each unlabeled field. The usual ones are the newsletter signup in the footer, the search box, and quantity or sort-by selects.
- A visible label is best. If the design has no room, a visually hidden label or an aria-label still gives the field a name.
- Check autocomplete values against the standard list: name, email, tel, street-address, postal-code, country and so on.
Fix it on your platform
Shopify
- Shopify's theme accessibility guidance says all form fields include a label, using aria-label, visually hidden text, floating labels or a visible label.
- Find the field in your theme code (Online Store → Themes → ⋯ → Edit code); the newsletter form is usually in a footer or newsletter section file. Add a label tied to the input's id, or an aria-label.
- Fields added by apps (reviews, pop-ups, chat) are fixed by the app's developer.
<label for="NewsletterEmail" class="visually-hidden">Email address</label>
<input id="NewsletterEmail" type="email" name="contact[email]" autocomplete="email">WordPress
- Form plugins usually have a setting per field for its label; fill it in, and avoid "placeholder only" or "hide label" options unless they keep a hidden label.
- The core Search block has a search label you can toggle. Keep it, or replace it with clear visible text next to the field.
- Fields from your theme (header search, newsletter) are fixed in the theme or by its developer. Themes tagged accessibility-ready must label their form fields.
Webflow
- Give each form field an ID in its Settings panel.
- Select the field's Label, open Settings → Custom attributes and add an attribute named for, with the field's ID as its value. This is the method Webflow's own help center describes.
- For a field with no visible label, add a custom attribute aria-label to the field instead.
Wix
- Wix recommends showing a field title on every form field (hover over the title, click More actions → Show field title) and making each title specific, rather than relying on placeholder text.
- Run the Accessibility Wizard (Settings → Accessibility Wizard → Scan Site) to find remaining issues.
- Fields in custom code or embedded third-party forms need labels added in that code.
Squarespace
- Click each field in your form block and fill in its label. Put longer guidance in the description, not the label.
- Newsletter and form fields from embeds or code injection need labels added in that code.
Next.js
- Tie each input to a <label> with htmlFor and id, or wrap the input in the label. Use aria-label only when there's no visible text.
<label htmlFor="email">Email address</label>
<input id="email" name="email" type="email" autoComplete="email" />Any other site
- Give each field one <label> with a for attribute that matches the field's id. For a search box with only an icon button, aria-label works.
<label for="email">Email address</label>
<input id="email" type="email" autocomplete="email">
<input type="search" aria-label="Search products">Check that it's fixed
- Click a field's label: the cursor should move into that field.
- Re-run your StudioLNC audit: the fields should no longer be listed.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.