Skip to content
ShopifyRule: svg-img-alt•Reviewed Oct 2026

Provide accessible text for SVG images with role img in Shopify

SVGs with `role="img"` must contain an accessible label or `<title>` element.

What's wrong

Screen readers announce an unlabelled SVG with `role="img"` as an empty graphic without context.

Who it affects

Screen reader users miss branding, icons representing payment methods, or rating stars.

How to fix on Shopify

Add `<title id="svg-title-{{ id }}">Label</title>` inside the SVG and reference it with `aria-labelledby="svg-title-{{ id }}"`.

Code example

Problematic Code
LIQUID
<svg role="img" viewBox="0 0 24 24">
  <path d="..."></path>
</svg>
Recommended Accessible Code
LIQUID
<svg role="img" viewBox="0 0 24 24" aria-labelledby="store-logo-title">
  <title id="store-logo-title">{{ shop.name }} logo</title>
  <path d="..."></path>
</svg>

How to check your fix

Test with a screen reader to confirm the SVG announces the descriptive title rather than remaining silent.

Check if your site has this issue

Scan any public store page free against WCAG 2.2 AA in 30 seconds.

Your session has ended

Sign in again to carry on. Anything you typed on this page is kept.

Signed in another way? Use another method (opens a new tab)