Someone uploads a 4 MB hero image straight out of a stock site, drags it into WordPress, and moves on. Six months later they're wondering why their product page takes 6.2 seconds to load on mobile while a competitor's loads in under two. I've watched this exact scene play out on client sites more times than I can count, and the fix is almost never "buy a faster server." It's the images.
Optimizing images for SEO is one of those tasks that looks trivial and turns out to touch almost everything: page speed, Core Web Vitals, Google Images visibility, and increasingly, whether AI-powered search surfaces can read what your visual content actually shows. Most guides stop at "rename your files and add alt text." That's the equivalent of tuning a guitar by checking one string. Below is the full setup—what actually moves rankings, what I've tested, and where I wasted weeks chasing things that didn't matter.
Key Takeaways
- File naming, alt text, and compression are table stakes—they get you indexed, not ranked.
- The real ranking lever is page experience: oversized images are the single most common cause of a failed Largest Contentful Paint.
- Next-gen formats (WebP, AVIF) and responsive
srcsetattributes cut payload by 60-80% on the sites I've audited. - Google Images traffic is measurable in Search Console—if you're not tracking the "Image" search type separately, you're flying blind.
- AI search tools read your alt text and surrounding context, not your pixels. Semantics beat file size for visibility there.
Image SEO basics that actually move rankings
Google doesn't "see" your photo the way you do. It reads signals: the filename, the alt attribute, the caption, the surrounding paragraph, the schema markup, and the page it sits on. Get those right and Google can match your image to a query. Get them wrong and your beautiful product shot becomes invisible.
Why file names matter more than people think
That export from your camera or design tool is probably called IMG_4821.jpg or final-v3-FINAL.png. Rename it before upload to something a human would search for.
- Good:
leather-messenger-bag-brown.jpg - Bad:
IMG_4821.jpg - Separate words with hyphens, never underscores
- Keep it under ~five words; stuffing keywords here reads as spam
A mistake I made early on: I renamed hundreds of images across a client's site in a single afternoon, then panicked when nothing changed for three weeks. Ranking shifts from image work typically lag page-level changes—I've seen 4 to 6 weeks pass before Search Console showed meaningful movement. Patience is part of the process.
Alt text is not a keyword dump
Alt text exists for screen readers first. It also happens to be what Google reads when it can't process the image itself. Write it like you're describing the image to someone on the phone.
"Brown leather messenger bag with brass buckles on a wooden table" beats "leather bag, buy leather bag, best leather bag online." Every time. The second one trips spam filters and helps no one. If an image is purely decorative, leave the alt attribute empty—an empty alt="" tells screen readers to skip it, which is correct behavior.
Image SEO best practices for format and file size
Here's where most sites bleed performance. On a recent audit of a mid-sized e-commerce store, I found 340 product images averaging 1.8 MB each. Compressing and converting them to WebP cut the homepage payload from 9 MB to just under 2 MB. Time to first contentful paint dropped from 4.1s to 1.6s on a throttled 4G connection.
Choose the right format for the job
| Format | Best for | Typical savings |
|---|---|---|
| JPEG | Photographs, complex gradients | Baseline |
| PNG | Logos, transparency, flat colors | Poor for photos |
| WebP | Almost everything, widely supported | 25-35% smaller than JPEG |
| AVIF | Modern browsers, best compression | Up to 50% smaller than WebP |
| SVG | Icons, simple vector graphics | Scales infinitely, tiny files |
WebP is the safe default—every major browser supports it. AVIF offers better compression but encoding is slower, so I only reach for it on image-heavy pages where the tradeoff pays off. For logos and icons, SVG is the obvious choice and I'll die on that hill: it scales to any size, weighs almost nothing, and stays crisp on retina displays.
Responsive images with srcset
Serving a 2000-pixel-wide image to a 400-pixel phone screen is pure waste. The srcset and sizes attributes let the browser pick the right file for each device:
<img src="bag-800.webp"
srcset="bag-400.webp 400w, bag-800.webp 800w, bag-1600.webp 1600w"
sizes="(max-width: 600px) 400px, 800px"
alt="Brown leather messenger bag">
This one change halved mobile data usage on a photography blog I run. And if you're on a CMS, most modern image CDNs (Cloudflare Images, Cloudinary, ImageKit) generate these variants automatically—you just point at their delivery URL.
Lazy loading—and when not to use it
loading="lazy" defers off-screen images until the user scrolls near them. Great for long galleries. Terrible for your hero image, because it can delay the Largest Contentful Paint—the exact metric Core Web Vitals cares about. Keep the hero image eager-loaded and lazy-load everything below the fold.
How to get your images indexed and found
An optimized image that Google never crawls is just a file sitting on a server. Three things get your visuals into the index.
Image sitemaps
Standard XML sitemaps can include image extensions that tell Google exactly where your visuals live and what they're about. Most SEO plugins generate these automatically, but I've seen plenty of sites where the setting was off and nobody noticed for months. Check yours.
The robots.txt crawl trap
If your robots.txt blocks your /images/ or /uploads/ directory, Google can index the page but never the image. I inherited a site once where a previous developer had blocked the entire media folder to "save crawl budget." It took me a full afternoon to figure out why Images traffic sat at zero.
Context beats the image itself
Captions, headings, and the paragraph next to an image all feed relevance signals. A photo of a hiking boot sitting alone on a page about tax law will never rank for hiking queries. Place images where they're genuinely relevant, and write captions that add information rather than restating the alt text.
Measuring image SEO performance
Open Google Search Console, go to the Performance report, and switch the search type filter to Image. Most people never do this. The data is there: which queries bring image traffic, which pages earn impressions, and where your click-through rate is embarrassingly low.
On one client's recipe blog, images drove 38% of total organic clicks—a number nobody on the team had ever looked at. Once we saw it, we prioritized image work for months and grew that channel by roughly a fifth quarter over quarter.
Image SEO in the age of AI search
AI-powered search surfaces pull context from your alt text, captions, and structured data—they can't yet reliably interpret the pixels in a photo. This flips the old priority. A perfectly compressed file with lazy alt text like image1.jpg is invisible to these tools, while a slightly heavier image with a precise description and clear surrounding text gets picked up.
My rule now: semantic clarity first, then compression. Both matter, but if I have to choose which to nail on a rushed project, I make sure the machines can understand what's in the picture.
The part most guides skip
Image SEO isn't one task you complete and forget. It's a discipline that runs alongside every content update, every product upload, every redesign. The sites that win image visibility aren't the ones with the fanciest CDN—they're the ones where someone remembers to rename a file and write a real description before hitting publish. Boring, unglamorous, and it compounds for years. The question worth sitting with: if someone audited your last ten image uploads right now, how many would pass?