How to fix button name on Adobe Commerce (Magento)
Add a descriptive, screen-reader-accessible name to every button on your site so assistive technology users know what each button does.
Steps for Adobe Commerce (Magento)
- Identify the offending button in your theme's template files. In your custom theme directory (app/design/frontend/Vendor/ThemeName/), locate the relevant .phtml template — e.g. Magento_Catalog/templates/product/view/addtocart.phtml for Add to Cart, or Magento_Theme/templates/html/header.phtml for header icons.
- Open the template file and add aria-label attributes to any icon-only <button> elements. Example: <button type="button" class="action search" aria-label="Search">.
- For buttons rendered by JavaScript UI components (e.g. KnockoutJS-bound elements), locate the corresponding HTML template in the module's web/template/ directory and add the aria-label there.
- After editing, run bin/magento cache:clean and bin/magento setup:static-content:deploy to apply changes.
- For third-party module buttons you cannot edit directly, create a layout XML override or a plugin/observer to modify the block's template output.
- Test on your staging environment with a screen reader and the axe DevTools extension before deploying to production.
What is button name?
Every button on a webpage must have an "accessible name" — a short piece of text that describes what the button does. This name is what screen readers announce aloud when a blind or low-vision user navigates to that button. An accessible name can come from visible text inside the button (e.g. "Add to Cart"), an `aria-label` attribute, or a linked text element. When a button has no accessible name — for example it contains only an icon or an image with no alt text — screen readers may announce it as simply "button," leaving users with no idea what it does. WCAG Success Criterion 4.1.2 (Name, Role, Value) requires all interactive controls to have a programmatically determinable name.
Screen reader users — a significant and growing segment of online shoppers — cannot use your store if they cannot identify your buttons. A "Search," "Add to Cart," or "Checkout" button with no accessible name is effectively invisible to them, directly costing you sales and customers. Beyond conversions, accessibility failures like this create real legal exposure: lawsuits under the ADA (US), the European Accessibility Act (EU), and equivalent laws worldwide increasingly target e-commerce stores. Google also uses accessibility signals as a proxy for page quality, so fixing these issues can contribute positively to your organic search rankings and Core Web Vitals scores. Fixing unnamed buttons is one of the highest-impact, lowest-effort accessibility improvements you can make.
See the complete Button name 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 button name and every other issue across your whole site.
Scan my site free