Why you should use alt tags for accessibility (instead of SEO)

Why you should use alt tags for accessibility (instead of SEO)

Adam Soucie's Layout avatar

Accessibility can be a controversial subject. Proper accessibility habits sometimes conflict with established (or at least common) practices in other aspects of the web development industry. Nowhere is this more true that with the alt attribute and SEO.

More commonly referred to as an “alt tag.” The alt attribute on images are a popular target for additional SEO optimization. It makes sense – search engines crawl alt tags when they are present. But more often than not, your images shouldn’t even have an alt attribute at all.

Images as progressive enhancement

The WCAG 2.0 Guidelines are clear on whether or not an image should have a non-text alternative. Non-text content (images, video, audio, etc.) should have an alt attribute or “text alternative that serves the equivalent purpose.” You may think that settles the debate and that all images should have an alt tag where we can add in some SEO terms. It’s not quite that simple. The WCAG guidelines provide a specific exception for decorative images:

The WCAG guidelines provide a specific exception for decorative images:

“If non-text content is pure decoration, is used only for visual formatting, or is not presented to users, then it is implemented in a way that it can be ignored by assistive technology.” 

The tricky part is defining “pure decoration” because we’re venturing into opinion territory. In this writer’s opinion, nearly every image you add to web content is for decoration. Even graphs and charts should be described by their accompanying text instead of an alt tag. Images are a progressive enhancement for the text-based medium that is the web.

HTML as a language was written to be forward-compatible, meaning the original text-based browsers will still be able to process modern HTML5 pages. Those browsers just ignore elements they don’t understand, including images. Since HTML is the true language of the web, keep that in mind when creating content for it.

We could, and I expect we will, debate the idea of images as progressive enhancement for days. But once you accept the concept, you need to answer the alt tag question. What should your decorative images have as their alt attribute?

The empty alt

For the longest time, I defaulted to just not including an alt tag on my images. While this does the job of not having a text alternative for something that doesn’t need it, it doesn’t signal to screen readers and other assistive technologies that the image can be safely skipped over. For this you need a blank alt attribute.

The blank attribute should be implemented like so:

<img src=”/directory/my-image.jpg” alt=””>

The empty alt tag is important here. When assistive technologies come across it, they know to skip over the image completely. They treat it as if it doesn’t exist instead of announcing an image that lacks a description. This leaves the user blissfully unaware of the image instead of being left to wonder how to describe it.

What about SEO?

SEO experts are likely shaking their heads by now, and that’s okay. alt attributes are one of the instances where SEO and accessibility disagree. It’s important to realize the purpose of the alt tag is very specific. It exists to provide a text alternative for the image in question. The alt attribute itself is an assistive technology; it does not exist to improve your SEO.

There are other ways to improve your image SEO, including naming your image files in ways that help their ability to be found and indexed. I’m not an SEO expert, so I won’t pretend I know them all. What I can tell you is you are making your site less accessible by including alt tags where they aren’t needed.

Have you read Adam’s three-part series on accessibility? Get started here!

Wrapping it up

The concept is simple, but it may take a while to get used to. Just remember, when writing your content, even with SEO in mind, describe your images in your actual content. Use the images as an enhancement to your text, not a requirement. Your SEO information and keywords belong in your content, not your image metadata. This way, having an empty alt attribute won’t seem so weird.

Ready to learn more about SEO and accessibility? 

Comments ( 4 )

  1. Mahesh Charjan

    May 12, 2018

    Very amazing article like this certainly help people grow such as me.I would have never knew about it if i would have read this post.


  2. Sarah T.

    January 9, 2018

    Hey, Adam,

    appreciate the article. I do have something to ask, mind you.

    What character count would you suggest for image alt text? I've read opinions ranging from just three words all the way to 120 characters, which seems a bit excessive.

    Also, do you think it should be unique for every image? Do you think it's better to include no alt tag than to use the same one for a batch of images? Even if we are talking about photography portfolio websites, where there could be at least two hundred images and up to, say, thirty on one page?

    I’ve done some digging around with WebAnalysis (the address is found through clicking on my name for those who need it, but really, there are plenty of such tools easily found through Google), few seem to really bother with that, at least those photographers that I compete with directly. I know it takes a lot of time.. but if it brings benefits in ranks, maybe it’s worth it.

    Hoping to hear your thoughts on this

  3. tricksempire

    October 22, 2017

    Very well explained the importance of Alt Tags (Alt Text). I followed the strategy to put LSI keywords and Synonyms to the primary keyword as alt tags for images (if there are images more than one in an article).
    Such articles got some boost in SERP.
    One more thing I would like to mention here is, Make sure the alt tag and name of the image are same. In this way, it will be very helpful for search engines to index your images in a right manner. :D

  4. Jake Ryan

    October 14, 2017

    Great for users - Using alt text on your images can make for a better user experience.

Join the discussion