Support » Accessibility » Empty Alt Not Displaying Correctly

  • When leaving the alt text blank on decorative images, WordPress is not adding correct empty alt tags, alt="", but adding either alt or no alt attribute at all. I’ve found this happening on three different WordPress installs. Is there a resolution for this?

    • This topic was modified 5 months, 1 week ago by michaelj206.
Viewing 2 replies - 1 through 2 (of 2 total)
  • According to the technical standard, when an attribute has just the attribute name (eg alt), the value is implicitly the empty string (ie alt="").

    That is: alt is implicitly the same as alt=""

    And <img src="line.jpg" alt> = <img src="line.jpg" alt="">

    Of course, you may have your personal preference, and that is fine.

    I just wanted to clarify that what WordPress is doing here (ie using alt instead of alt="")is technically correct according to the standard, and is even equivalent to what you’re asking for.

    If no alt attribute is being added at all, that’s a different issue, and I would love to know the condition under which this is happening. I tested adding images in the editor, but I couldn’t reproduce this.



    so if the alt attribute is empty (alt=””, aka a “null” tag) it will not be announced to the user.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.