• This topic seems to come up every now and again but there doesn’t seem to be a clear statement about it anywhere. (If there is, I apologise – please point me to the right place).

    When adding/editing an image in Media, there is a box for the alt text. Underneath it states:

    ‘Describe the purpose of the image (opens in a new tab). Leave empty if the image is purely decorative.‘ (My emphasis).

    However, if you try to include a image without the alt text, the block editor refuses to insert it and, instead, puts the message ‘This image has an empty alt attribute; its file name is xxx’, this despite the fact that the same input box and message saying that the alt attribute is optional can be seen in the block settings sidebar.

    So is use of the alt attribute in WordPress optional or not? At the very least, the instructions should be consistent.

    I know all the good reasons why one should use the alt attribute but, outside of WordPress, it is not compulsory so I am not sure why it should be within WordPress (if that is, in fact, the case).

    • This topic was modified 4 years, 7 months ago by infmgt.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I’ve tested locally and I’m not seeing this happen. Just trying to make it happen too and can’t yet.

    If I create a new post, add an image, leave the alt filed blank and publish, it publishes just fine without this message. WP version 5.4. Can you share a screen shot and the steps you took that displays this message?

    Thread Starter infmgt

    (@infmgt)

    You’re right. I just created a new post (and a new static page) and they worked fine. The problem seems to be with pages I created a couple of weeks ago. These were created on my laptop using an xampp installation of WP and recently transferred to my hoster’s server using the WordPress Importer plugin.

    I’ve put a screenshot here.

    By the way, is there a way to put an attachment in this forum? I don’t see one. As you will have gathered, I’m pretty new to all this and I appreciate you taking the time to sort me out

    I am having the exact same issue with the latest version of WordPress. I have over 1200 images!!! Is this a new requirement in WordPress that ALL images have an alt value? This is creating serious issues for those trying to edit and post for a brand new live site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Empty alt attribute’ is closed to new replies.