Using images for SEO is often overlooked, but picking a good image file name and HTML tags for your images can help your website get found online. When search engines look at your website, they consider all the text on your site as well as the file names you use for pages and images.
Image File Names
First let’s look at the image file names. Your image file name should give the user an idea of what the picture is going to be before they ever see it. When a website uses an image, the image file URL is formed from the file name. So if you have a picture of Yankee Stadium, here are some good and bad file names to consider:
- Bad: img_0190.jpg – this could be anything, and the search engine has no idea what this file is
- OK: stadium.jpg – this at least gives us a clue of what the picture is
- Best: yankee-stadium-1999.jpg – not only do we know what the picture is, we even know when it was taken. Notice how the words are separated with dashes, which makes the file name readable by both humans and search engines.
The Image ALT Tag
The ALT tag is an HTML tag used for images. If a web page loads correctly you will never see the text in this tag, but if an image is missing, the text inside the ALT tag will sometimes load in the web page instead. The image ALT tag is also seen by devices that read pages for vision-impaired users. And of course, the search engines read the text in the ALT tag too. The ALT tag should give a description of what the image is showing.
Continuing our Yankee Stadium example from earlier, we could use any of the following for the ALT tags. This text will get indexed by the search engine along with the images:
- Yankee Stadium 1999
- Yankee Stadium – empty seats – 1999
- Yankee Stadium – 1999 sellout crowd for first home game
The ALT tag goes inside the img tag, like this. Note that you can use it in lower-case or upper-case form; the web browser doesn’t care:
<img src="images/yankee-stadium-1999.jpg" alt="Yankee Stadium in 1999">
Unlike the image ALT tag which you normally won’t see, image captions help the website visitor understand what they’re looking at. Here again, this in another opportunity to put your keywords on your website. Just like the ALT tag, these captions should be descriptive and add value to the reader. Some good and bad image captions:
- Worst: no caption
- Bad: Figure 1 (Unless I’ve read the page I don’t know what this is supposed to be)
- Good: Yankee Stadium on the first home game in 1999 – a sellout crowd comes to cheer on the team
There is no HTML tag for adding a caption, so it takes a little more effort to put a caption under your photo.
Make your image files only as large as necessary and as small as possible. If you have an image that’s going to take up 100 pixels of width, there’s no reason for the image to be 640×480. Also remember that 72 dpi is a perfectly good resolution for on-screen viewing; save the 300 dpi file for the printer. Sizing down your images reduces the amount of bandwidth used by your site and, more importantly, your webpage will load faster. Also, large images squeezed into tiny spaces tend to look skewed and compressed.
Using your images for SEO readability may add a few minutes to your webpage setup, but the time you invest up-front will give you a good boost in the search engine ratings.