Images are simultaneously an SEO opportunity and a common SEO liability.
Poorly optimized images slow pages down and waste their potential as search signals. Well-optimized images contribute to page speed, accessibility, relevance, and Google Image Search visibility.
This guide covers every image SEO factor that matters in 2026.
File Names: The First Signal
When you upload an image, its file name is the first signal search engines use to understand what the image shows.
Bad:
IMG_4829.jpgimage001.pngscreenshot_20240315.jpg
Good:
web-design-services-bangkok.jpgtechnical-seo-audit-checklist.jpgastro-website-speed-comparison.jpg
Best practices:
- Use descriptive file names that reflect the image content
- Include a relevant keyword where natural (do not force it)
- Use hyphens to separate words (not underscores, not spaces)
- Keep file names concise — 3-6 words is usually enough
- Set file names before uploading — renaming after upload requires updating the src attribute
Alt Text: Required for SEO and Accessibility
Alt text is an HTML attribute that describes what an image shows. Search engines read it. Screen readers announce it to visually impaired users.
HTML:
<img src="technical-seo-audit.jpg" alt="Technical SEO audit checklist for small business websites" />
Best practices:
- Describe what the image actually shows — be specific
- Include a relevant keyword naturally, where it genuinely describes the image
- Keep it concise: 5-15 words for most images
- Avoid starting with “image of” or “picture of” — search engines already know it is an image
- For decorative images (design elements, dividers), use empty alt text:
alt=""
What to avoid:
- Keyword stuffing:
alt="SEO services SEO agency best SEO cheap SEO Bangkok" - Generic descriptions:
alt="photo" - Missing alt text entirely (common on sites with many images)
- Identical alt text on multiple different images
Check your alt text: Our Image SEO Checker audits every image on a page and flags missing or problematic alt text.
Image Formats: Use WebP
Not all image formats are equal for SEO. Format affects file size, which directly impacts page speed.
| Format | Best for | SEO notes |
|---|---|---|
| WebP | Photos, illustrations, screenshots | Best choice for most web images — 25-35% smaller than JPEG |
| JPEG | Photos when WebP unavailable | Good quality-to-size ratio for photography |
| PNG | Transparent backgrounds, sharp graphics | Larger files than WebP for photos; good for logos/icons |
| SVG | Icons, logos, illustrations | Vector format — perfectly sharp at any size; minimal file size |
| AVIF | Emerging alternative to WebP | Even smaller than WebP; growing browser support |
| GIF | Simple animations only | Large files; avoid for static images |
Modern Astro sites automatically convert images to WebP/AVIF using the <Image> component. This is one of the reasons Astro websites load significantly faster than equivalent WordPress sites.
Compression: Reduce File Size Without Losing Quality
Large image files are one of the most common page speed killers. An uncompressed photo can be 3-8MB; a well-compressed WebP version of the same image might be 50-150KB.
Target file sizes:
- Hero images: under 200KB
- Blog post images: under 150KB
- Small thumbnails/icons: under 30KB
- Full-page background images: under 400KB
Free compression tools:
- Squoosh.app — browser-based, excellent WebP conversion
- TinyPNG / TinyJPG — fast, simple compression
- ImageOptim (Mac) — batch compression tool
In Astro: the <Image> component handles compression and format conversion automatically at build time. No manual work needed.
Image Dimensions: Right Size, No Oversizing
Loading a 4000x3000px image and displaying it at 800x600px wastes bandwidth and slows load time. The browser downloads the full-size image regardless of the display size.
Best practices:
- Use images at or close to their display dimensions
- Use
srcsetandsizesattributes for responsive images (serve different sizes to different devices) - Never load a 3000px image to display at 300px — resize it first
- Always specify
widthandheightattributes on<img>tags to prevent Cumulative Layout Shift (CLS)
Why CLS matters: If an image loads without dimensions set, the browser does not reserve space for it. When it loads, the page jumps — causing a CLS penalty and a bad user experience.
Lazy Loading: Defer Off-Screen Images
Images below the fold do not need to load when the page first opens. Lazy loading defers them until the user scrolls near them.
HTML:
<img src="image.webp" alt="Description" loading="lazy" width="800" height="450" />
Important: Do NOT lazy load images that are visible above the fold when the page loads. Lazy loading your hero image will hurt your LCP (Largest Contentful Paint) score significantly.
General rule:
- First image on the page (hero, featured image):
loading="eager"or no loading attribute - All images below the fold:
loading="lazy"
Image Sitemaps
For sites where images are a significant part of the content (photography, e-commerce, news), an image sitemap helps Google discover and index images that might otherwise be missed.
Include image data in your regular sitemap using the image extension:
<url>
<loc>https://example.com/page/</loc>
<image:image>
<image:loc>https://example.com/images/example.jpg</image:loc>
<image:title>Descriptive title of the image</image:title>
</image:image>
</url>
Check your sitemap with our Sitemap Checker.
Structured Data for Images
For articles and blog posts, Article schema should include the image property pointing to your featured image. This helps Google understand the primary image associated with the article:
{
"@type": "Article",
"image": {
"@type": "ImageObject",
"url": "https://webaloha.co/images/blog-image-seo.jpg",
"width": 1200,
"height": 630
}
}
Including image dimensions in the schema helps Google understand the image’s aspect ratio without having to download it.
Google Image Search Optimization
Images with strong alt text, descriptive file names, and relevant surrounding content can rank in Google Image Search — a secondary traffic channel worth claiming.
Additional tips for image search:
- Place images near relevant text content (Google uses surrounding text as context)
- Use high-quality, original images rather than stock photos (more likely to be featured)
- Add image captions where relevant — they provide additional keyword context
- Ensure the page the image lives on is properly indexed
Quick Image SEO Checklist
For every new piece of content:
- Descriptive file names set before upload (hyphens, keywords where natural)
- Alt text on every image (specific, descriptive, not stuffed)
- WebP format used where possible
- Images compressed below target file sizes
- Hero/above-fold image has
loading="eager"or no loading attribute - Below-fold images have
loading="lazy" -
widthandheightattributes set on all images - Featured image included in Article schema with dimensions
Run an audit: Image SEO Checker checks all images on any page instantly.
Image SEO is part of the full on-page SEO checklist. For a complete picture of your site’s SEO health, the technical SEO audit guide covers all the infrastructure factors. Our SEO Services include image optimization as part of every engagement.
Frequently Asked Questions
What is image SEO?
Image SEO is the practice of optimizing images on your website to help search engines understand them, improve page load speed, and increase the chances of your images appearing in Google Image Search. Key elements include descriptive file names, meaningful alt text, proper compression, appropriate dimensions, and modern image formats like WebP.
What is alt text and why does it matter for SEO?
Alt text (alternative text) is an HTML attribute that describes what an image shows. It matters for SEO because search engines cannot see images — they rely on alt text to understand image content. Alt text also improves accessibility for users who rely on screen readers. A descriptive alt text that naturally includes a relevant keyword can contribute to both page rankings and image search visibility.
What image format is best for SEO?
WebP is the recommended format for most web images in 2026. It provides 25-35% smaller file sizes than JPEG at equivalent quality, which improves page speed without sacrificing visual quality. JPEG remains appropriate for photos when WebP is not supported. PNG is best for images that require transparency or sharp graphics like logos and icons. Avoid large uncompressed TIFFs or BMPs.
Does image file name matter for SEO?
Yes. Search engines read file names as a signal for what an image shows. ‘web-design-services-bangkok.jpg’ is significantly better than ‘IMG_20240315_092341.jpg’. Use descriptive, keyword-relevant file names with words separated by hyphens. This contributes to both page relevance signals and image search rankings.
How do I check images on my website for SEO issues?
Our free Image SEO Checker analyzes all images on any page and checks for missing alt text, oversized dimensions, large file sizes, non-descriptive file names, missing width and height attributes, and other image-related SEO issues. Enter any URL and get an instant audit.
What is lazy loading for images?
Lazy loading is a technique that delays loading images that are below the fold (not visible in the current viewport) until the user scrolls down to them. This improves initial page load time and Largest Contentful Paint (LCP) scores. In HTML, it is enabled with the loading=‘lazy’ attribute on image tags.


