How to fix label on Adobe Commerce (Magento)
Add a visible or programmatic label to every form input so assistive technologies can identify it for users.
Steps for Adobe Commerce (Magento)
- Locate the relevant `.phtml` template file for the form — e.g. `app/design/frontend/<Vendor>/<Theme>/Magento_Checkout/templates/` for checkout fields, or `app/design/frontend/<Vendor>/<Theme>/Magento_Search/templates/form.mini.phtml` for the search form.
- Add `<label for='input-id' class='label'><span>Descriptive text</span></label>` before the `<input id='input-id'>` element. For visually hidden labels use Magento's built-in `.visually-hidden` utility class on the label.
- For the mini-search input, add `aria-label='<?= $block->escapeHtml(__('Search')) ?>'` directly on the `<input>` element.
- Clear the Magento cache: go to System → Cache Management → Flush Magento Cache, or run `bin/magento cache:flush` from the CLI.
- Verify with the axe browser extension on the storefront.
What is label?
Every form field on your site — search boxes, email sign-up fields, checkout inputs, contact forms — must have a label that describes what the field is for. A "label" in web terms is either a visible `<label>` element paired with the input, or a special accessibility attribute (like `aria-label`) that provides the same description invisibly. When a form field has no label at all, the browser and assistive technology have nothing to announce to the user about what that field is asking for. WCAG Success Criterion 4.1.2 requires all form controls to have a name that assistive technology can read out loud.
Screen-reader users — including customers with visual impairments — will hear something like "edit text, blank" when they reach an unlabelled field, with no clue what to type. This makes checkout, sign-up, and contact forms completely unusable for those customers, directly costing you sales and leads. From a legal standpoint, unlabelled form fields are one of the most frequently cited accessibility violations in ADA and WCAG-based lawsuits and demand letters targeting e-commerce stores. Google also uses accessible markup signals as a quality indicator, so fixing labelling issues supports your site's overall technical health. Fixing this is typically a quick code change that immediately improves usability for everyone, including mobile users who rely on tap-targets and auto-fill.
See the complete Label 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 label and every other issue across your whole site.
Scan my site free