An alt attribute is a piece of text accompanying an image on a website that explains what is shown in the image. The alt text was originally intended for visually impaired people who use a text-to-speech solution, which reads the alt attribute aloud. Nowadays, search engines also use it a lot, making it even more important. The text is not visible on the image, but is included in the HTML code so that it is visible to search engines and disability aids.
Search engines use these pieces of descriptive text to better understand what a page or image is about, enabling them to provide a better search experience.
What does an alt attribute look like?

For example, a good alt attribute for this image would be: ‘Two people discussing something at a computer.’ You could refine this slightly to match the subject of the page where the image appears, so that it can be found on Google. Do not stray too far from the truth, as this is of no use to visually impaired people. Search engines will also rank you lower because they actively want to prevent this kind of behaviour in order to show relevant results.
An example of what the HTML code looks like on an image (img tag) with an alt attribute.
When should you not use the alt attribute?
It is not necessary to use an alt attribute on images or icons that are used purely for illustrative purposes. So if your image is not specifically linked to the subject you are discussing, it is better not to give it an alt tag. This also applies to icons or atmospheric images.
It is better to have no alt attribute than one that does not describe the image, as mentioned earlier, this will harm your position in the search engines.
Adding an alt attribute on WordPress
There are several ways to add alt texts on WordPress. The most important one is to give an image a different alt attribute when editing the post.

- Open a blog post to edit it.
- Select the image you’d like to change
- In the menu on the right, you can edit the alternative text.
- Click publish!
Wijzig het alt-attribuut in een WordPress-blogbericht.

- In your WordPress admin, go to the media library.
- Select an image
- Edit the alternative text on the right-hand side.

