Alt Attribute

Joran Hofman
February 7, 2021

What is an Alt Attribute?

The alt attribute is commonly referred to as the ‘alt description’ or ‘alt-text’. It is an attribute that is used within the HTML language and it’s used to associate text within an image and helps us to further understand it.

When to use Alt Text?

The alt-text is used in some of the following ways:

  1. To be able to access the web, labels or text have to be placed on the images or photos. This helps the visually impaired to make use of screen readers in order to understand more about an image on the page.
  2. When an image does not load correctly, the alt text will be displayed instead.
  3. Alt texts are used to help search engine crawlers register an image correctly.

Why is The Alt Text Important in SEO?

For SEO, the use of alt text on images is of utmost importance because in addition to enriching the user's browsing experience, it can help optimize the search for images on the web, especially in the cases where there is a misclassification by search engines.

How To Use The Alt Attribute in WordPress.

When you upload an image to WordPress, you can give it a title and an alt attribute. Inside Wordpress you can see that the program places the alt-attribute by default, the file name of the image in the title attribute. This happens when the user does manually specify it. It is recommended to spend time on each image to create a good alt text. 

Here's how to do it:

  • Login to the WordPress website.
  • In the 'Control Panel', open the publication or web page to modify the content.
  • Click on the image block to open the image settings.
  • Add alt text and title attribute.
  • Then add an alt text in WordPress.
  • Click the 'Update' button in the upper right corner.

Best Practices To Write a Good Alt Text.

The alt text must be an accurate description of the image content so people know exactly what they are looking at.

  • Length. It is recommended that the alt text is no longer than 125 characters because most screen readers shorten the text.
  • Use of keywords. The alt text field gives another chance to add a target keyword to a page. 
  • It is not advisable to use keyword stuffing. It is recommended to focus on writing the alt text to describe the image and if necessary, a keyword can be included.
  • Avoid using images as text. This is because search engines cannot read the text contained within your images. If necessary, you should explain this within the alt text.
  • Remember the longdesc tag = This can be used when an image requires further explanation.
  • Be careful with the form buttons. Every image on a website that has one or more buttons must have an "alt" attribute that indicates what the button's function is, such as "buy", "register", "sell", etc.

Explore more glossaries