Most WooCommerce stores have hundreds of product photos and alt text on a handful of them. Products get imported from a CSV, a supplier feed or a migration, and the images arrive with no description at all. This guide shows where WooCommerce keeps that text, how to list every product photo that is missing it, what good product alt text looks like, and how to fill the gaps without editing images one by one.
WooCommerce does not have its own alt field. Product images are ordinary WordPress media attachments,
and the alt lives on the attachment, in the post meta key _wp_attachment_image_alt.
The product only points at its images:
| Image | Where the product references it |
|---|---|
| Main product image | _thumbnail_id meta on the product |
| Product gallery | _product_image_gallery meta on the product (comma-separated attachment IDs) |
| Variation image | _thumbnail_id meta on each product_variation post |
Two consequences people trip over:
With SQL (phpMyAdmin, Adminer or wp db query; replace wp_ with your
table prefix). Main images of published products with no alt, or an empty one:
SELECT p.ID AS product_id, p.post_title AS product, a.ID AS image_id, a.guid AS image_url
FROM wp_posts p
JOIN wp_postmeta t ON t.post_id = p.ID AND t.meta_key = '_thumbnail_id'
JOIN wp_posts a ON a.ID = t.meta_value
LEFT JOIN wp_postmeta alt ON alt.post_id = a.ID AND alt.meta_key = '_wp_attachment_image_alt'
WHERE p.post_type = 'product' AND p.post_status = 'publish'
AND (alt.meta_value IS NULL OR TRIM(alt.meta_value) = '');
Change 'product' to 'product_variation' for variation images. Gallery images
are a comma-separated list, so they are easier to check from the media side.
With WP-CLI, every image in the Media Library that has never had an alt saved:
wp post list --post_type=attachment --post_mime_type=image \
--meta_key=_wp_attachment_image_alt --meta_compare="NOT EXISTS" \
--fields=ID,post_title,post_parent --format=table
This catches images with no alt meta at all, which is what imports usually produce. An alt
that was saved and later cleared is stored as an empty string and needs the SQL version above.
post_parent shows the product an image was first uploaded to, when there is one.
| # | The image | Bad alt | Good alt | Why |
|---|---|---|---|---|
| 1 | Main image of a hoodie product, front view | hoodie-front-v2-final.jpg | Organic cotton zip hoodie in forest green, front view | The file name is what many themes fall back to. Product, material and color are what the shopper checks. |
| 2 | Variation image for the "Sand" color of the same hoodie | Organic cotton zip hoodie in forest green, front view | Organic cotton zip hoodie in Sand, front view | Copying the main alt to every variation tells a screen-reader user all colors look the same. Use the variation name as the store spells it. |
| 3 | Gallery photo: the hoodie's inside label and seams | hoodie | Inside of the hoodie: brushed fleece lining and flat-locked seams | Each gallery image exists to show something new. Describe that, not the product again. |
| 4 | Product photo of a 1 kg bag of coffee beans | coffee beans buy coffee online best coffee shop | 1 kg bag of Ethiopia Yirgacheffe whole coffee beans, resealable kraft pouch | Keyword lists are read aloud word for word and look like spam to search engines. Size and packaging are real product facts. |
| 5 | Size chart image attached to a T-shirt | size chart | Size chart: S 46 cm, M 51 cm, L 56 cm, XL 61 cm chest width, measured flat | Text inside an image is invisible to screen readers. Put the data in the alt, or better, also as a table on the page. |
| 6 | Bundle photo: a skincare set laid out | gift set | Skincare gift set: cleanser, toner, 50 ml moisturiser and a cotton pouch | For "what you get" photos the contents are the information. |
| 7 | Lifestyle photo: a desk lamp on a cluttered home-office desk | Modern home office with laptop, plant, books, mug and lamp | Black adjustable desk lamp lighting a laptop keyboard on a home-office desk | Describe the product you sell; mention the scene only as context. |
| 8 | Close-up of a ring's engraving | Image of ring | Close-up of the inner band engraving in script lettering, sterling silver | Screen readers already say "image". Close-ups are for detail, so give the detail. |
More product photo cases are in alt text examples for product photos, and the general rule behind all of them in WCAG 1.1.1 alt text requirements.
Writing these by hand works for twenty products, not for two thousand. Alt Text BYOK is a WordPress plugin that finds every image in the Media Library missing alt text and writes it with an AI vision model, using your own API key (OpenAI, Anthropic, Gemini, OpenRouter and others), so you pay the provider directly, cents per hundred images, with no subscription in between.
wp alt-text generate --limit=100 to run it from WP-CLI on large catalogs.Upload a product photo to the free generator and see the alt it writes (3 images a day, no signup). Then let the plugin do the whole catalog.
Alt Text BYOK for WordPress Download the free version Try the free generatorNot sure how many images are missing? See WordPress images missing alt text for the store-wide check, including images outside WooCommerce.