Seach Engine Optimization - An ALT for every IMG
June 11, 2009
Rob Ackerman
One important way to increase your SEO is through adding an alternate text ("alt") attribute to every img tag. There is no better way for Google to understand what an image is about than for you to tell them. Google's all-powerful engine cannot "see" images, yet.
While there is much discussion on how much the alt attribute on an image helps for SEO; Search Engine Optimization is about being the least imperfect. Better to have them and not need those alt tags and have them than not have them and get dinged for it. Correctly applied alt attributes give you a chance to tell the search engines what your pictures are about and get a few more instances of your keywords onto your page. However it is extremely important that your alternative text is actually relevent to your image, that you don't stuff keywords into it, and keep the alt text to a reasonable size.
What is a reasonable size you ask? One rule of thumb (there are many) is to make number of words in the alternate text relative to the actual image size. The formula I use is (image width / 40 + image height / 16). This is only one guideline and also serves as a maximum. For the header image on this page we arrive at a maximum of 26 words (614 x 175 -> 15.35 + 10.9 = 26.25). For images that play only a decorative role in your page you can use an empty alt. For example: alt="".
Other reasons for using the alt attribute on your img tags is that it is mandatory for your X(HTML) to be considered valid by the W3C and it is mandatory for accessibility according to the Americans with Disibilities Act (ADA). Although it currently only applies to local and state government websites, it is still a good idea to make your site available to anyone who is interested.
Provide a text equivalent for every non-text element (e.g., via "alt", "longdesc", or in element content). This includes: images, graphical representations of text (including symbols), image map regions, animations (e.g., animated GIFs), applets and programmatic objects, ascii art, frames, scripts, images used as list bullets, spacers, graphical buttons, sounds (played with or without user interaction), stand-alone audio files, audio tracks of video, and video
Web Content Accessibility Guidelines
As a final note, while you are adding your alt text to your images, take the time and rename your images, where appropriate, to contain your keywords and to use a "-" instead of _ when naming your images.