What Is Alt Text?
Alt text is short for ‘alternative text’. It is entered into HTML code in association with an image, and is called alternative because it is an alternative to the image. It is meant to convey the image to users who cannot see or interpret it, for whatever reason. When the image is not displayed, most browsers will display the alt text in the space where that image should be, along with an empty icon.
The alt text of an image is specified in HTML code in the following way: <img src=”image.gif” alt=”Image”>. In this example the alt text ‘Image’ is associated with image.gif. Alt text should always be specified for every image. If it is not wanted, blank alt text should be entered like this: alt=””. Otherwise, the image’s web address will usually be displayed, which is irritating for those who rely on alt text to understand images.
There are several reasons why users may not be able to see or interpret an image. Those who have difficulties with their vision or who have cognitive disabilities may wish to employ screen readers. These read out the alt text in place of the images. Alt text may also be useful if there is a problem with the image loading on a user’s browser, or if they have chosen to disable images in their browser. Most importantly for SEO, alt text is read by search engine spiders to interpret images on web pages, since they are not usually able to interpret images directly.
Alt Text and SEO
The job of the alt text is therefore to describe the image for those who cannot see or interpret it. However, alt text is also valuable for SEO since it is a good place to put keywords which likely to be used by those searching for the services or products you supply. However, you should not be tempted to stuff all of the relevant keywords into the alt text. For example, if you have an image of a dog and you are a business selling dog food, you should not stuff the alt text of this image with all possible keywords users looking for your product may enter into search engines, as is shown in the following example: <img src=”dog.gif” alt=”dog, dog food, canine, food for dogs, food for canines, dog health, healthy food for dogs“>.
This is called keyword stuffing and is not good practice. This is because it negates the intended use of alt text, which is to describe images for those who cannot see or interpret them. You can imagine how this would irritate those using screen readers for example. Due to this, Google and other search engines penalise those who employ keyword stuffing, which means that besides from being unethical it is also no longer effective. A good rule of thumb to keep in mind when using alt text is to think of accessibility first and SEO second. Only use keywords when they do not detract from the accessibility of the alt text.
Another rule of thumb is to use just enough words in the alt text to adequately describe the image. You should be specific. For example, an image of a book should perhaps have an alt tag with the title and author of the book. However, don’t give a long description. You should usually be able to keep the alt text to less than ten words.