This site requires JavaScript to be enabled

When should an icon have alternative text?

11086 views

2.0 - Last modified on 2021-07-29 Revised by Anika Rally

1.0 - Created on 2021-04-06 Authored by Brian DeConinck

When adding an Icon block to your post or page, you have the option of including alternative text.

Icon block settings with "Needs alternative text" toggled off. Icon block settings with "Needs alternative text" toggled on.

Alternative text contains the information that the icon is intended to communicate, and is announced to users of assistive technology. Alt text is important for making sure your website is accessible.

An easy rule of thumb: If the icon wasn't there, would your page still make sense? If it wouldn't make sense, add alt text.

Alt text best practices

In general, try to follow these best practices:

Example of an icon that needs alt text

Matrix of services with checkmark and "x" icons for different use cases.

In this example, checkmark and X icons are used to indicate when each WordPress service is a good fit for each use case. If the icons weren't there the content wouldn't make any sense. In this case, each icon would need alt text. Good alt text might be "Yes" for the checkmark icons and "No" for the X icons---or whatever text you would normally enter if you weren't using icons.

Example of an icon that does not need alt text

A passage from a book describing planting trees, with a decorative icon of a sapling.


In this example, an icon is used decoratively to illustrate a quote from a book. The icon itself doesn't communicate any information, and the content would still make sense if the icon wasn't there. In this case, alt text should not be added.

Other icon blocks

Other blocks that support icons (like the Callout block or the Icon + Text block) pair the icon with some kind of text or heading. These blocks assume that the icon is purely decorative, and do not give the option for adding alt text.