Guides · Accessibility
How to write alt text for images
People who use screen readers cannot see a picture, so they rely on a text description called alt text. Some images on your page have none. Alt text also appears if an image fails to load. Without it, a screen reader may read out the file name or skip the image.
What alt text does
Alt text sits in the image's code, in the alt attribute. Visitors who can see the image do not normally see it.
How to write it
Imagine describing the image to someone over the phone. One short sentence is usually enough.
- Say what the image shows and why it is on the page. "Baker holding a tray of rye loaves" says more than "bakery photo".
- Leave out "image of" or "picture of". Screen readers usually announce that it is an image.
- If the image contains words, such as a sale banner, include those words.
- If the image is a link and has no other text, describe where the link goes.
- Do not stuff it with search terms. Yoast and Rank Math may look for a keyword in alt text, but the description should still make sense to a listener.
There is no fixed length limit in the standard. Shopify allows up to 512 characters and recommends 125 or fewer.
When to leave it empty
Some images add nothing: a divider line, a background pattern, or a photo whose caption already says the same thing. These should have an empty alt, written as alt="", so screen readers skip them.
The attribute still has to be present. A single space does not count, and our test reports it as a failure. Some builders leave the attribute out when the field is blank, and others write it empty, so rescan to find out which yours does.
How to add it
- Open your report and look at which images it lists.
- Find each one in your site editor and open its settings.
- Enter the description and publish.
The field is in a different place on each platform, and menus change:
- WordPress: select the image in the editor, or open it in the Media Library, and fill in Alternative Text. Editing the Media Library may not change copies already placed in posts, so check those too.
- Shopify: product images take alt text in the Products area of the admin. Theme images take it in the theme editor.
- Wix: click the image, open its settings and fill in the field "What's in the image?".
- Squarespace: open the image's settings and look for an alt text field. The field differs by image type, and the file name may be used if you enter nothing.
If an image comes from a theme or app and has no field, ask its developer to add an alt attribute.
A rescan shows whether alt text exists. It cannot tell whether the text is accurate, so read your descriptions once yourself.