Woocommerce has their own free theme called storefront. I am using this theme for a website I have been working on. While I was working on some seo best practices I noticed something quite shocking. The featured image for products is missing its alt tag..

At first I wasnt sure if I caused the issue so i checked their demo's of the theme and they too are missing the alt tag..

Is there a way to fix this via my child theme? If not child theme I am happy to update the parent theme.

Any help is much appreciated!

  • Have you added a description in the media library? Under the hood WooCommerce just uses get_the_post_thumbnail() which automatically adds the alt text. I suspect the demo just doesn't have any added to their example images. Feb 5 '18 at 8:34
  • Yes i added alt and description text in the media library to the images. However in my experience ALL images have alt attributes even if there is no value. It is just empty alt=""
    – Patrick
    Feb 5 '18 at 10:54
  • This is correct HTML. Image elements should have alt tags. If they are present and have no value then screen readers will ignore them, rather than do something undesirable like read out the URL or filename. But your question made it sound like there were no alt tags? Feb 5 '18 at 11:18
  • 1
    There are NO alt tags on featured images on the current theme. When i said in my experience i meant the past. There should be an empty alt tag if there is no alt value in the media library. However there is no alt tag ever, regardless. There is NO alt tag. It is missing. All im searching for is a solution on how add it.. Its not a dashboard fix. I need to know what file and what code to add to add the alt tag to featured images. If i switch to ANY other theme it works fine.
    – Patrick
    Feb 5 '18 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.