How to Automatically Generate Alt Text in WordPress
Accessibility is important. But it’s also difficult to manage. The a11y checklist is a great resource to ensure your web projects are up to snuff. WordPress has some accessibility baked in, but it doesn’t check all the boxes.
Wether you’re on a small team, or managing a WordPress install by yourself — ensuring all your images have
alt text can be a real pain in the rear.
Upon activating the plugin, you head over to the Microsoft Computer Vision API Center and grab an API Key for the plugin. Enter the key in Settings > Media and you’re off. Here’s an example of the plugin in action.
I bumped the confidence threshold down to 5% just to see what it would pump out. So far, it’s been pretty accurate. Personally, screenshots and PNGs tend to throw off the generator in my tests. Quick sidenote: the plugin doesn’t seem to work with WordPress 4.9 at the moment, but it will work up to WordPress 4.8.3
That being said, the plugin will only generate
alt text for images uploaded after activation. It won’t add
alt text to images previously uploaded. Not a huge ordeal, but moving forward the computer vision generated
alt text will help you keep you site’s images a11y compliant without breaking a sweat.
If you liked this post, make sure to Like it below! Subscribe to my monthly newsletter Hypertext Digest, and never miss a post 😀