Image SEO Best Practices: Alt Text, File Names, and Structured Data
Most developers treat images as decoration and stop optimizing once the file is small. But images are also content that search engines index — and Google Images is a significant, often-overlooked traffic source. With a handful of habits around file names, alt text, captions, and structured data, the same images you already compressed can start earning clicks of their own.
Key Takeaways
- Descriptive file names and
alttext give search engines (and screen readers) the context they need. - Alt text is for accessibility first; good accessibility and good SEO almost always coincide.
- Fast, properly sized images rank better because performance is a ranking signal.
- Image sitemaps and
ImageObjectstructured data help Google discover and understand your media.
1. Use Descriptive File Names
The file name is the first clue a crawler gets about an image, and it is the easiest thing to get right. IMG_8421.jpg tells Google nothing; red-leather-office-chair.webp tells it exactly what the picture shows. Use lowercase words separated by hyphens, keep it concise and genuinely descriptive, and avoid keyword stuffing — chair-chair-best-chair-buy-chair.webp helps no one.
2. Write Alt Text That Earns Its Place
The alt attribute is the workhorse of image SEO. Screen readers announce it to visually impaired users, browsers display it when an image fails to load, and search engines lean on it to understand the image's subject. Write it as a clear, natural description of what the image actually depicts — as if you were describing it to someone over the phone.
<!-- Vague and useless -->
<img src="chair.webp" alt="chair">
<!-- Descriptive and helpful -->
<img src="chair.webp"
alt="Red leather ergonomic office chair with chrome base">
<!-- Purely decorative? Use an empty alt so it is skipped -->
<img src="divider.webp" alt="">
The decorative-image exception
Not every image needs descriptive alt text. Purely decorative elements — dividers, background flourishes, spacer graphics — should use an empty alt="" so assistive technology skips them rather than reading out noise. Leaving the attribute off entirely is different and worse; always include it, even if empty.
3. Captions and Surrounding Context
Search engines also read the text around an image to judge its relevance. A visible caption (ideally with <figure> and <figcaption>), a descriptive heading nearby, and relevant body copy all reinforce what the image is about. Captions carry a bonus: they are among the most-read text on a page, so they serve users as well as crawlers.
<figure>
<img src="great-barrier-reef.webp"
alt="Aerial view of the Great Barrier Reef's coral formations"
width="1200" height="800">
<figcaption>The Great Barrier Reef stretches over 2,300 kilometres
along Australia's north-east coast.</figcaption>
</figure>
4. Performance Is an Image SEO Factor
This is where everything ties together. Because Core Web Vitals influence ranking, a slow, oversized image actively hurts the SEO of the whole page it sits on. Serving modern formats like WebP, sizing images to their display dimensions, and adding explicit width and height attributes are therefore not just performance chores — they are image SEO. The fast image and the discoverable image are the same image.
5. Help Google Discover Images with a Sitemap
If important images are loaded via JavaScript or CSS backgrounds, crawlers may miss them. An image sitemap (or image entries within your regular sitemap) explicitly lists the URLs you want indexed, improving the odds they appear in image search.
<url>
<loc>https://example.com/products/office-chair</loc>
<image:image>
<image:loc>https://example.com/img/red-office-chair.webp</image:loc>
</image:image>
</url>
6. Add Structured Data
Schema.org structured data helps search engines understand what an image represents and can make it eligible for rich results. For product, recipe, article, and similar content, providing image URLs in your JSON-LD markup gives Google a strong, machine-readable signal about which images matter.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Ergonomic Office Chair",
"image": [
"https://example.com/img/red-office-chair.webp"
]
}
</script>
7. Lazy-Load Without Hurting Indexing
Native lazy loading via loading="lazy" is safe for SEO — Google handles it well — as long as the image's URL is present in a standard src or srcset. Where teams get burned is hiding the real URL behind custom data-src attributes that only a script populates; if that script never runs for the crawler, the image is invisible. Stick to the native attribute, and remember the golden rule: never lazy-load your above-the-fold LCP image.
Make every image fast and findable
Great image SEO starts with a fast, modern file. Convert and resize yours to WebP in seconds with our free, private, browser-based optimizer.
Optimize Images NowAbout WebPMagic
WebPMagic is an independent project focused on image optimization and web performance. These guides are researched and edited to give developers clear, practical, and accurate information for building faster websites, with tips drawn from hands-on use of our own WebP conversion tool. Found an error or have a suggestion? Let us know via our contact page.