← All guides

Image SEO: Filenames, Alt Text & Formats

Images can drive real search traffic — if you optimize them. Filenames, alt text, formats, sitemaps, and Core Web Vitals: the complete image SEO playbook.

By Formatly

Images are an underrated SEO asset. Google Images drives meaningful traffic in e-commerce, food, travel, DIY, and dozens of other niches — and image optimization also feeds directly into Core Web Vitals, which affect your regular rankings. Here’s the complete playbook, in order of impact.

1. Use descriptive filenames

IMG_2041.jpg tells Google nothing. handmade-leather-wallet-brown.jpg tells Google everything. Rename files before uploading:

  • Describe the image contents concisely: blue-mountain-bike-trail.jpg
  • Use hyphens, not underscores or spaces: Google treats hyphens as word separators
  • Keep it under ~5 words; don’t stuff keywords
  • Don’t change filenames of already-indexed images without setting up redirects — you’ll break existing image rankings

This is the single highest-ROI image SEO task. It takes seconds per image and most sites skip it entirely.

2. Write real alt text

Alt text serves two masters: accessibility (screen readers) and SEO (Google can’t “see” images, so alt text is its understanding of the content).

Good alt text describes what’s in the image as if explaining it over the phone:

  • ✅ alt="Barista pouring latte art into a ceramic cup on a wooden counter"
  • ❌ alt="coffee" (too vague)
  • ❌ alt="best coffee shop latte art coffee beans espresso" (keyword stuffing — Google penalizes this)
  • ❌ Empty alt on a meaningful image (a missed opportunity)

Decorative images (borders, spacer graphics, purely aesthetic flourishes) should have empty alt text (alt="") so screen readers skip them. Don’t stuff keywords into decorative images — it dilutes the real ones.

Title attributes and captions: the title attribute adds little SEO value; skip it. Captions are indexed and read by users — use them for important images, since caption text gets more engagement than body copy.

3. Choose formats Google rewards

Google explicitly recommends modern formats, and format choice affects the performance metrics Google measures:

Use caseBest formatWhy
PhotographsWebP or AVIFSmallest files, fastest LCP
Graphics / logosSVG, then WebPSVG is infinitely scalable and tiny
Fallback for old browsersJPGUniversal compatibility

Serve modern formats with <picture> fallbacks so every browser gets something. And compress aggressively — Google’s crawlers measure your page speed, and images are usually the biggest contributor.

4. Size images to their display dimensions

Serving a 4000px image in a 800px slot is pure waste: wasted bytes, slower Largest Contentful Paint, worse rankings. Resize to (at most) the largest size the image will actually display — typically 1× and 2× variants for retina:

<img src="wallet-800.jpg"
     srcset="wallet-800.jpg 1x, wallet-1600.jpg 2x"
     alt="Handmade brown leather wallet">

WordPress and most modern CMSs generate srcset variants automatically — but only from the file you upload. Upload a sensibly-sized original and the CMS does the rest.

5. Lazy-load below-the-fold images

<img src="..." alt="..." loading="lazy">

One attribute, enormous impact on initial page load. Exception: never lazy-load the hero/LCP image — that delays the metric you’re trying to improve. Browsers also support fetchpriority="high" for the hero image.

6. Add images to your sitemap

Google discovers images by crawling pages, but an image sitemap (or the image extensions in your regular sitemap) guarantees discovery — especially for images loaded via JavaScript galleries that crawlers might miss. Include the image URL, title, and caption. Most SEO plugins generate this automatically.

7. Surrounding content matters

Google uses the text around an image to understand it: the heading above it, the paragraph below it, the page’s overall topic. An image of a wallet on a page about wallets with a relevant heading and caption is far more likely to rank in image search than the same image on an unrelated page. Place images near relevant text, not in decorative sidebars.

8. Structured data for rich results

Product pages should use Product schema with the image property — it’s what powers product images in search results. Recipes, articles, and how-tos have their own image requirements for rich results. Valid structured data won’t rank a bad image, but it makes a good image eligible for enhanced display.

The Core Web Vitals connection

Images are the #1 cause of poor Largest Contentful Paint (usually the hero image) and Cumulative Layout Shift (images without dimensions pushing content around). Fix both:

  • Preload or prioritize the hero image
  • Always include width and height attributes (or CSS aspect-ratio) so the browser reserves space before the image loads
  • Compress everything — every 100 KB you cut is LCP time saved

What NOT to do

  • Text baked into images. Google can’t read it (reliably), users can’t copy it, it looks terrible on mobile. Use real HTML text overlaid on images instead.
  • Keyword-stuffed alt text. It’s a spam signal, not an optimization.
  • Hotlinking images from other sites. Slow, unreliable, and bandwidth theft. Host your own.
  • One giant “SEO” image. Ten well-optimized specific images beat one generic stock photo for image search traffic.

Practical next steps