Skip to content
WordPressRule: image-alt•Reviewed Oct 2026

Add descriptive alt text to images in WordPress

Every product and theme image needs meaningful alternative text so screen reader users know what is displayed.

What's wrong

Images rendered without an `alt` attribute or with missing descriptions prevent screen readers from announcing what the image portrays.

Who it affects

People who are blind or have low vision and use screen readers cannot tell what products or graphics look like. Users on low-bandwidth connections where images fail to load also rely on alt text.

How to fix on WordPress

In WordPress, always specify alternative text when uploading images in the Media Library. When coding theme templates or blocks, use `wp_get_attachment_image( $id, 'full' )` which automatically includes the stored alt text. For custom markup, use `esc_attr( get_post_meta( $id, '_wp_attachment_image_alt', true ) )`.

Code example

Problematic Code
PHP
<img src="<?php echo esc_url( $image_url ); ?>" />
Recommended Accessible Code
PHP
<?php echo wp_get_attachment_image( $attachment_id, 'large', false, array( 'class' => 'product-featured-image' ) ); ?>

How to check your fix

Inspect the rendered HTML in Chrome DevTools to confirm every `<img>` has an `alt` attribute. Run an axe-core or screen reader check and verify decorative images have `alt=""` while informative images have clear, concise descriptions.

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)