How to Automatically Add Alt Text to WordPress Images (With AI)

If you want to nail your WordPress site’s SEO and make your website more accessible to visitors with screen readers, you should be adding alt text to all of the images that you use in your content.

However, adding alt text is also time-consuming, especially if you use a lot of images. That makes it easy to forget (or just skip, if you’re feeling lazy).

So what if there were a better way? A way to automatically add accurate, contextual image alt text to your WordPress images using the power of machine learning and artificial intelligence (AI)?

As you can probably guess, there is a better way, and I’m going to show you how to set it up using a free plugin in this post.

How AI-Powered Automatic Image Alt Text Works

The automatic image alt text method that I’m going to show you is based on Microsoft’s Cognitive Services AI, which is part of the Microsoft Azure suite of services. That sounds intimidating, but it’s pretty painless to set up.

Essentially, Microsoft’s Cognitive Services AI can look at an image and then describe what’s happening in plain English.

For example, if you feed it an image of a sheep standing in a grassy field, it can say that the image contains a sheep grazing in a grassy field.

Here’s a real example of what it’s like after setting everything up.

I can upload this image to my WordPress site:

Original image

Then, the plugin will hook into Microsoft’s Cognitive Services AI to automatically generate this image alt text without me lifting a finger:

A horse grazing on a lush green field

WordPress automatic image alt text

It even calls the field “lush”. Cool, right?

If you upload a lot of “real” images like the example, this is an awesome way to save some time.

However, this method isn’t perfect, and it won’t work for all types of images.

For example, if you’re uploading detailed interface screenshots (like the images in the rest of this post), the alt text that the tool generates isn’t very accurate because it can’t grasp the detail of what you’re doing in the interface.

I tried uploading one of the screenshots from the tutorial below, and the automatic image alt text wasn’t relevant or useful.

Still, for a lot of WordPress sites, this is a great way to save some time while boosting your SEO and website accessibility.

How to Set Up Automatic Image Alt Text on WordPress

To start using automatic image alt text, you can use the free Automatic Alternative Text plugin from Jacob Peattie.

The plugin is pretty easy to use. However, there are two limitations that you should be aware of:

  1. The plugin only works for newly uploaded images. It is not able to add alt text to all of your existing images. At the end of the post, I’ll share a paid alternative that does allow this.
  2. It only adds alt text in English, so it’s probably not a good option for sites in other languages. It might work for a multilingual website where one of your languages is English. However, I haven’t tested it that way, so I can’t guarantee that.

If that’s fine with you, you can go ahead and install and activate the free Automatic Alternative text plugin from WordPress.org. Then, here’s how to set it up…

1. Generate Microsoft Azure Computer Vision API Key

To set the plugin up, you’ll need to start outside your WordPress dashboard.

Specifically, you’ll need to register for a Microsoft Azure account and generate an API key that lets you connect your WordPress website to Microsoft’s Computer Vision service.

Azure is Microsoft’s suite of cloud computing services. In addition to Computer vision, you can also host your WordPress site on Azure.

You can use the Computer Vision service for free for an entire year. After that, it’s still quite affordable. You’ll pay just a fraction of a penny for each image that you generate alt text for.

To begin, go to Microsoft Azure and register for your free account. You’ll need to enter a credit card to verify your account, but Microsoft will not bill you unless you explicitly opt into it once your 12 months of free usage expires.

In your Azure portal, use the search box at the top to search for “Computer Vision”. Then, select the search result from the Marketplace:

Access API

Next, fill out the details. In the Pricing Tier drop-down, make sure to select Free F0. For the others, you just need to enter names to help you remember everything – don’t stress too much about what you enter.

Then, click Create at the bottom:

create resource

You’ll then need to wait a few minutes while Microsoft deploys your resource.

Once Microsoft is finished, you should see a prompt to go to the resource’s dashboard. If you don’t see the prompt, you can always search for the resource by name using the search box at the top of the interface.

In the dashboard for that resource, go to the Keys and Endpoint tab. Then, you need to get the values for two pieces of information:

  • Key 1
  • Endpoint

Keep these two values handy as you’ll need them in the next step:

API key

2. Add API Key to WordPress

Once you have your API key and Endpoint URL, leave that tab open and open a new tab to access your WordPress dashboard.

In your WordPress dashboard, go to Settings → Media. Then, scroll down to the Automatic Alternative Text section and paste in your Endpoint URL and API Key.

You’ll also need to choose your Confidence threshold. Essentially, this tells the service how “confident” you want it to be to add the image alt text. A higher confidence threshold will ensure accurate alt text, but it might also skip more images when the tool is uncertain.

When in doubt, I recommend leaving this as the default (15%):

Add API key to WordPress

And that’s it!

When you upload new images to your WordPress site, the plugin should automatically add image alt text – you don’t need to lift a finger.

I tested, and it works in both the Classic editor and the new WordPress block editor, so you shouldn’t have any problems either way.

Start Using Automatic Image Alt Text Today

As I mentioned earlier, this method is not great if you’re posting lots of interface screenshots. However, for “real” pictures, I’ve found it to be eerily accurate, and it does everything on autopilot.

Plus, you can use Microsoft’s Computer Vision service for free for a year. And it’s still super affordable after that.

Finally, it will help you make friends with the AI before AI takes over, and we enter into a Terminator scenario.

Ok, that last one might not be a true benefit…

If you’re looking for a more feature-rich alternative, you can consider the freemium Image SEO plugin, which uses the same AI approach but includes other features (such as file renaming and bulk optimization for older images). However, the free tier is quite limited, so you’ll probably end up paying to use it.

Do you have any questions about how to set up automatic image alt text on WordPress? Leave ’em in the comments!

Colin Newcomer

Colin Newcomer

Colin Newcomer is a freelance writer and long-time Internet marketer. He specializes in digital marketing, WordPress and B2B writing. He lives a life of danger, riding a scooter through the chaos of Hanoi. You can also follow his travel blog.

Related Articles

Coupons

Join the conversation!

THE #1 WORDPRESS THEME BUILDER

Create Your Own

Building beautiful WordPress websites has never been easier. Explore the visual drag & drop Theme Builder that does it all, and works on any theme. Coding skills needed: none.