Image alt text serves three audiences: screen-reader users who can't see the image, search engines that index image meaning, and sighted users when images fail to load. Missing or bad alt text fails all three. The fix isn't just "add some text" — it's writing the right kind of alt for the image's role. This guide covers the four image categories and how to write alt for each. For related fixes, see the Accessibility Fixes index.
Purely visual, no information value. Background patterns, divider lines, icons paired with visible text labels. Treatment: alt="" (empty alt).
<!-- Decorative pattern --> <img src="/divider-pattern.svg" alt=""> <!-- Icon paired with text - icon decorative --> <button> <img src="/icon-trash.svg" alt=""> Delete </button>
Conveys meaning or information. Product photos, illustrations, infographics. Treatment: describe the content concisely.
<img src="/products/red-shoe.jpg"
alt="Red leather running shoe with white sole">
<img src="/team/jane-doe.jpg"
alt="Jane Doe, Chief Engineering Officer">
Image is itself a link or button — alt describes the action, not the picture.
<!-- Logo linking to homepage --> <a href="/"> <img src="/logo.svg" alt="AIWebPageSEO home"> </a> <!-- Icon-only button --> <button> <img src="/icon-close.svg" alt="Close dialog"> </button>
Too rich for one alt string. Use short alt for headline meaning, longer text description nearby or via aria-describedby.
<img src="/sales-chart-2025.png"
alt="Q4 2025 sales by region"
aria-describedby="chart-desc">
<p id="chart-desc">
EMEA led with $4.2M, followed by APAC at $3.1M,
Americas at $2.8M. EMEA grew 23% year-over-year.
</p>
alt="IMG_2342.jpg" — useless// Bulk-edit via WP-CLI for posts with no image alt
wp eval-file fix-alt.php
// fix-alt.php
$posts = get_posts(['post_type' => 'attachment', 'numberposts' => -1]);
foreach ($posts as $post) {
if (!get_post_meta($post->ID, '_wp_attachment_image_alt', true)) {
// Set sensible default based on filename
$alt = derive_alt_from_filename($post->post_title);
update_post_meta($post->ID, '_wp_attachment_image_alt', $alt);
}
}
Product images: Shopify Admin → Products → bulk-edit. Each product image has an alt field. For large catalogues, use the Bulk Editor or export CSV, edit, re-import.
Add an alt-text field as required on every image upload schema. Existing content without alt: write a one-off migration script to detect images and queue for alt-text writing.
add_filter('attachment_fields_to_save', ...) rejects save if alt empty AND not flagged decorative. Shopify: customise theme to display warning. Headless: schema-level required validation.