How to Optimize Images for SEO
Image SEO goes beyond speed: filenames, alt text, captions, image sitemaps, structured data and crawlable lazy-loading for Google Images and rich results.
Image SEO is the practice of optimising images so search engines can understand what they show and surface them in results, including Google Images and richer result types. It overlaps with image performance optimisation (file size, modern formats) and with accessibility (alt text), but its specific goal is discoverability and visibility in search, not page speed alone. The core signals are simple: descriptive filenames, accurate alt text, relevant captions and surrounding text, image sitemaps, structured data, and crawlable image URLs — including lazy-loading that does not hide images from crawlers. This guide covers each, and is careful to mark where image SEO meets performance and accessibility, because the smart move is to optimise once and benefit on all three fronts.
For the speed-focused side of the same work, pair this with how to optimize images for the web; for the accessibility side, see how to write good alt text for images.
What image SEO is (and is not)
It helps to draw the boundary clearly, because three related topics get conflated.
- Image performance optimisation is about making images light and fast — compressing them, sizing them correctly, using modern formats — so they do not slow the page. That is a speed and Core Web Vitals concern.
- Image accessibility is about making images usable by everyone, primarily through alt text that describes them for screen-reader users.
- Image SEO is about making images understandable and discoverable by search engines, so they can rank in Google Images and contribute to rich results.
These overlap heavily — alt text serves both accessibility and SEO; small file sizes serve both performance and image-search experience — but the goal of image SEO is visibility. Search engines cannot "see" an image the way a person does, so they rely on textual and structural signals around it to understand what it depicts. Image SEO is, in large part, the craft of providing those signals well.
Descriptive filenames
The filename is the first signal, and one of the cheapest to get right. A file called IMG_4821.jpg tells a search engine nothing; a file called red-leather-running-shoe.jpg tells it the image likely shows a red leather running shoe.
Best practices:
- Describe the content in the filename using real words.
- Use lowercase and separate words with hyphens (
blue-ceramic-coffee-mug.jpg), which is the convention engines parse most reliably. - Keep it concise and accurate — describe what the image shows, do not stuff keywords (
shoes-running-shoes-buy-shoes-cheap.jpgis spammy and unhelpful).
Filenames are a minor signal, not a major one, but they cost nothing at upload time and contribute to the overall understanding of an image alongside alt text and context.
Alt text: the most important signal
Alt text (the alt attribute) is the textual description of an image, and it is the single most important image-SEO signal because it directly tells engines — which cannot see the image — what it depicts. It is also, primarily, an accessibility feature: screen readers announce alt text so non-sighted users know what an image shows. The two purposes align almost perfectly, which is why good alt text is a rare win for both audiences.
Principles for SEO-and-accessibility-friendly alt text:
- Describe the image accurately and specifically, in the context of the page. "Golden retriever puppy sitting in grass" beats "dog" beats "" (empty).
- Keep it natural and concise — a short, true description, not a sentence stuffed with keywords.
- Do not keyword-stuff. Cramming target keywords into alt text harms accessibility (it reads as nonsense to screen-reader users) and looks manipulative to engines. Include a relevant keyword only if it genuinely describes the image.
- Leave alt empty for purely decorative images (
alt=""), so assistive tech skips them; this is correct accessibility practice and does not hurt SEO.
The full craft of alt text — including edge cases like complex images and decorative images — is covered in how to write good alt text for images. For image SEO, the headline is: write a true, specific, natural description.
Captions and surrounding text
Search engines use the context around an image to understand it, not just its own attributes. Two contextual signals matter:
Captions — visible text directly describing an image — are often read closely by users and provide a strong, human-facing description that engines also notice. Where a caption is natural (figures, product shots, photos in articles), a good one reinforces what the image is about.
Surrounding text — the paragraph and heading near the image — gives engines further context. An image of a chart placed within a section about, say, traffic growth, is understood partly through that nearby text. The practical implication is to place images near relevant content rather than dropping them in arbitrarily, and to let the page's text support what the image shows.
Choosing the right format and keeping images light
Here image SEO meets performance, and the overlap is worth stating because it affects image-search experience too. Use appropriate, modern formats — WebP or AVIF for photographs and complex images, SVG for logos and simple graphics, with JPEG/PNG as fallbacks where needed. Compress images and size them to their display dimensions so you are not shipping a 4000px image into a 400px slot.
Why this is an SEO concern and not only a speed one: fast-loading, correctly-sized images contribute to good page experience and Core Web Vitals (which feed Google's ranking signals), and a heavy, slow image is a worse result for image-search users. So format and weight decisions serve performance and the image's standing in search. The dedicated treatment is in how to optimize images for the web — for image SEO, the point is that light, well-chosen images are also better-ranking images.
Image sitemaps
Search engines discover images by crawling pages, but some images are easy to miss — those loaded via scripts, or buried in ways the crawler does not reach. An image sitemap helps by explicitly listing your images so engines can find them more reliably.
You can either add image information to your existing XML sitemap (annotating page entries with the images on them) or maintain image entries specifically for discovery. This is especially useful for image-heavy sites — e-commerce catalogues, photography sites, publishers — where image visibility is commercially important and where script-based galleries might otherwise hide images. An image sitemap does not guarantee indexing, but it improves the odds that engines find images they might otherwise overlook. It pairs with your normal sitemap work — see how to create an XML sitemap and submit it.
Structured data and rich results
Structured data can make images part of rich results, increasing their prominence. Several schema types incorporate images:
- Product markup includes product images, which can appear in rich product results and shopping surfaces.
- Recipe markup includes a dish image, eligible for recipe rich results with thumbnails.
- Article markup carries a representative image used in news and article displays.
- Other types (events, how-tos, and more) similarly attach images.
By marking up your content with the appropriate schema and including high-quality images in that markup, you help search engines associate the right image with the right entity and qualify for richer, more visual results. This is the image-specific slice of a broader topic covered in what is schema markup and which types you need. The principle: structured data helps engines use your images, not just find them.
Lazy-loading without hiding images from crawlers
Lazy-loading — deferring off-screen images until the user scrolls near them — is excellent for performance, reducing initial page weight. But it intersects with image SEO in a way that bites teams who get it wrong: if the real image URL is hidden behind JavaScript that a crawler does not execute, the engine may never discover the image. The deferral that speeds the page can accidentally make images invisible to search.
The fixes are well established:
- Use native lazy-loading via the
loading="lazy"attribute on<img>and<iframe>. The browser handles deferral, and the image'ssrcis still present in the HTML for crawlers to find. This is the simplest, safest approach. - If using a JavaScript lazy-load library, ensure the actual image URL is discoverable — for example in the markup (in
src, or a<noscript>fallback) — rather than only constructed at runtime in a way crawlers cannot see. - Test it. Use a URL inspection or rendering tool to confirm search engines can see your lazy-loaded images, not just users with JavaScript.
The goal is to keep the performance win of lazy-loading without sacrificing crawlability — the two are fully compatible when implemented with native lazy-loading or proper fallbacks.
The image-SEO reference table
Here is each factor, the signal it sends, and the action it implies.
| Factor | Signal to search engines | Action |
|---|---|---|
| Descriptive filename | Hints at image content | Use lowercase, hyphenated, descriptive names |
| Alt text | Describes what the image shows | Write accurate, specific, natural alt; no stuffing |
| Caption | Human-facing description | Add where natural; describe the image clearly |
| Surrounding text | Contextual meaning | Place images near relevant content |
| Format & size | Faster, better image result | Use WebP/AVIF/SVG; compress; size correctly |
| Image sitemap | Aids discovery | List images, especially on image-heavy sites |
| Structured data | Enables rich results | Add Product/Recipe/Article schema with images |
| Crawlable lazy-load | Keeps images discoverable | Use loading="lazy" or ensure URLs are in HTML |
Winning in Google Images
Google Images is a meaningful search surface in its own right, and the factors above are what drive visibility there. To recap the levers specifically for image search: provide clear textual signals (filename, alt, caption, context) so Google understands the image; make images discoverable (crawlable URLs, image sitemap); ensure images are high-quality and appropriately sized (a sharp, relevant, fast image is a better result); and use structured data where it applies. There is no secret trick — image-search visibility flows from the same understandable, discoverable, high-quality images that good image SEO produces throughout.
Common image-SEO mistakes
- Meaningless filenames like
IMG_1234.jpgthat pass no signal. - Missing or empty alt text on meaningful images, costing both SEO and accessibility.
- Keyword-stuffed alt text that reads as spam and helps no one.
- Lazy-loading that hides images from crawlers, so they are never discovered.
- Huge, uncompressed images that slow the page and degrade the result.
- Images placed without relevant surrounding context, leaving engines guessing.
- Ignoring image sitemaps and structured data on image-heavy or product sites where they matter most.
A practical image-SEO checklist
- Give images descriptive, lowercase, hyphenated filenames.
- Write accurate, specific alt text; leave decorative images' alt empty.
- Add captions and place images near relevant content.
- Use modern formats (WebP/AVIF/SVG), compress, and size correctly.
- Add an image sitemap, especially on image-heavy sites.
- Add structured data (Product, Recipe, Article) that includes images.
- Use native lazy-loading or ensure image URLs are crawlable.
- Test that search engines can see your lazy-loaded images.
Where to start if you only do a few things
If the list is long, start with the two highest-leverage, lowest-effort fixes that also serve accessibility. First, fix alt text across your meaningful images — accurate, specific descriptions — because it is the strongest image-SEO signal and an accessibility necessity at once. Second, rename images descriptively going forward (and fix the worst offenders), so new uploads carry a signal from day one. If you run an image-heavy or e-commerce site, add a third pass: confirm your lazy-loading is crawlable and add structured data with images, because that is where image visibility translates most directly into traffic and sales. Those moves capture most of the value, and because they overlap with performance and accessibility, the same effort pays off three times over.
Go deeper
- The performance side of the same work: how to optimize images for the web.
- The accessibility craft: how to write good alt text for images.
- Enable rich results: what is schema markup and which types you need.
- Help engines discover everything: how to create an XML sitemap and submit it.
Want image, performance and SEO issues flagged in one pass? Analyse any URL with StackOptic — one report, free, no sign-up.
Frequently asked questions
What is image SEO?
Image SEO is the practice of optimizing images so search engines can understand what they show and surface them in results, including Google Images. It covers descriptive filenames, accurate alt text, relevant captions and surrounding text, image sitemaps, structured data and crawlable image URLs. It overlaps with image performance optimization (file size and formats) and accessibility (alt text), but its specific goal is image discoverability and visibility in search rather than page speed alone.
Does alt text help with SEO?
Yes. Alt text describes an image for screen-reader users and for search engines, which cannot 'see' images. Accurate, descriptive alt text helps engines understand what an image depicts and is a factor in how images rank in Google Images. It also improves accessibility, which is its primary purpose. Write alt text that genuinely describes the image in context; do not stuff keywords, which harms both accessibility and credibility.
Do image filenames matter for SEO?
They help. A descriptive filename like 'red-leather-running-shoe.jpg' gives search engines a clue about the image's content, whereas 'IMG_4821.jpg' gives none. Filenames are a minor but genuine signal, and they cost nothing to get right at upload time. Use lowercase words separated by hyphens that describe the image. Combined with alt text and surrounding context, descriptive filenames help engines understand and rank your images.
What is an image sitemap?
An image sitemap is a way of listing your images in an XML sitemap so search engines can discover them more reliably, including images that might be loaded via scripts or otherwise hard to find. You can add image entries to your existing sitemap or use a dedicated image sitemap. It does not guarantee indexing, but it helps search engines find images they might otherwise miss, which supports visibility in image search.
Can lazy loading hurt image SEO?
It can if implemented badly. Lazy loading defers off-screen images to speed up the initial page load, which is good. But if the real image URL is hidden behind JavaScript that crawlers do not execute, search engines may never discover the image. The fix is to use native browser lazy loading (the loading='lazy' attribute) or ensure the image URL is present in the HTML so crawlers can find it while still deferring the actual load.
Analyse any website with StackOptic
Get the full technology stack, performance, security and SEO report in seconds — free.
Analyse a websiteRelated articles
How to Optimize a Blog Post for SEO and AI Search (GEO)
One workflow that serves Google and AI engines at once: intent, answer-first intros, scannable structure, schema, E-E-A-T, cited stats and freshness.
How to Handle Pagination for SEO
Pagination done wrong hides content from Google. The modern best practice: self-referencing canonicals, crawlable links, and view-all vs paginated.
How to Improve Your Click-Through Rate in Search
Ranking is half the battle — people still have to click. How to lift search CTR with better titles, meta descriptions, rich results and intent matching.