Empty alt attribute
-
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).
- The topic ‘Empty alt attribute’ is closed to new replies.