On-Page SEO

How to Optimize Images for SEO: Alt Text, Compression & More

OneClickExperts Team· SEO ExpertsMar 2, 20267 min read

Why Image Optimization Matters for SEO

Images make your content more engaging, help break up text, and can drive significant traffic through Google Image Search. But unoptimized images are also one of the leading causes of slow page loads, which directly hurts your SEO performance and user experience.

Image optimization is a two-sided practice: making images accessible and understandable to search engines (through alt text, file names, and context) while also ensuring they load quickly and do not degrade page performance. Get both sides right, and images become an SEO asset rather than a liability.

Alt Text: The Most Important Image SEO Element

What Is Alt Text?

Alt text (alternative text) is an HTML attribute that describes an image's content. It serves two critical purposes: it provides a text alternative for screen readers used by visually impaired visitors (making your site accessible), and it helps search engines understand what the image depicts (since search engines cannot "see" images the way humans do).

How to Write Good Alt Text

Effective alt text is descriptive, concise, and natural. Follow these guidelines:

  • Be descriptive: Describe what the image actually shows. "Woman running on a trail through a pine forest at sunrise" is much better than "image" or "photo."
  • Be concise: Aim for 125 characters or fewer. Screen readers may cut off longer alt text.
  • Include keywords naturally: If your target keyword is relevant to the image, include it. Do not force keywords into alt text where they do not belong.
  • Avoid starting with "image of" or "picture of": Screen readers already announce the element as an image. Starting with "image of" is redundant.
  • Describe function for functional images: If an image is a button or link, describe the action, not the image. "Submit contact form" rather than "green button."

Alt Text Examples

Bad: alt="" (empty alt text for an informative image)

Bad: alt="SEO keyword research tool free best SEO tools 2026" (keyword stuffing)

Good: alt="Dashboard of an SEO keyword research tool showing search volume and difficulty metrics"

Good: alt="Comparison chart of Flesch-Kincaid readability scores for top-ranking blog posts"

Image File Names

Before uploading an image, give it a descriptive file name. Search engines read file names as a relevance signal. "IMG_4392.jpg" tells Google nothing, while "seo-content-brief-template.jpg" clearly indicates the image's content.

Best practices for file names:

  • Use descriptive words that reflect the image content
  • Separate words with hyphens (not underscores or spaces)
  • Keep names concise (3 to 6 words is typical)
  • Include relevant keywords where natural
  • Use lowercase letters only

Image Compression and File Formats

Large, uncompressed images are the number one cause of slow page loads on most websites. Compressing images reduces file size while maintaining acceptable visual quality.

Choosing the Right Format

  • WebP: The preferred format for most web images in 2026. WebP provides superior compression with good quality and is supported by all modern browsers. Use it as your default format.
  • AVIF: Even better compression than WebP but slower to encode. Use for high-traffic pages where every kilobyte matters. Browser support is now widespread.
  • JPEG: Still fine for photographs where WebP is not an option. Use quality settings of 70 to 85 percent for a good balance of quality and file size.
  • PNG: Best for images that need transparency or contain text and sharp edges. Avoid PNG for photographs as it produces much larger files than JPEG or WebP.
  • SVG: Ideal for logos, icons, and illustrations. SVGs are vector-based, meaning they scale to any size without losing quality and are typically very small files.

Compression Guidelines

  • Aim for images under 100KB for blog post images
  • Hero images and banners can be 100 to 200KB if needed for visual impact
  • Use tools like Squoosh, TinyPNG, or ShortPixel for compression
  • Consider using your CMS or CDN's built-in image optimization features
  • Test compressed images to ensure quality is acceptable before deploying

Responsive Images and Sizing

Serving the same large image to both desktop and mobile devices wastes bandwidth and slows mobile load times. Use responsive image techniques to serve appropriately sized images based on the device.

  • Use the srcset attribute to provide multiple image sizes
  • Set explicit width and height attributes to prevent Cumulative Layout Shift (CLS)
  • Do not rely on CSS alone to resize images; serve images at the correct dimensions
  • Generate thumbnails for archive pages and full-size images for individual post pages

Lazy Loading

Lazy loading defers the loading of images that are below the fold (not visible when the page first loads) until the user scrolls to them. This significantly improves initial page load time and Largest Contentful Paint (LCP) scores.

In modern HTML, lazy loading is as simple as adding loading="lazy" to your image tags. Do not lazy load images that are visible above the fold, as this can actually slow down the perceived load time. Only lazy load images that users need to scroll to see.

Image Sitemaps

If images are a significant part of your content (photography sites, e-commerce, visual guides), submit an image sitemap to Google Search Console. An image sitemap tells Google about images on your site that it might not discover through regular crawling, especially images loaded via JavaScript.

Most CMS platforms and SEO plugins can generate image sitemaps automatically. Verify yours is working by checking Google Search Console's Sitemaps section.

Structured Data for Images

Adding structured data can help your images appear in rich results. For example, Product schema includes image properties that can show your product images in Google Shopping results. Recipe schema displays finished dish photos in recipe cards. The OneClickExperts schema generator makes it easy to include proper image references in your structured data.

Image SEO Checklist

  • Descriptive, keyword-relevant file names using hyphens
  • Concise, descriptive alt text on every informative image
  • Images compressed to under 100KB (WebP or AVIF format preferred)
  • Explicit width and height attributes to prevent layout shift
  • Lazy loading on below-the-fold images
  • Responsive images using srcset for different device sizes
  • Image sitemap submitted to Search Console (if applicable)

Start Optimizing Your Images

Image optimization is a quick win for both SEO and user experience. Audit your most-visited pages first, compress oversized images, add missing alt text, and implement lazy loading. These changes can improve page speed scores and search visibility within days of implementation.

Tags:image SEOalt textpage speed

Related Articles

On-Page SEO

How to Write Meta Tags That Boost Click-Through Rates

Learn how to write title tags and meta descriptions that increase click-through rates from Google. Includes character limits, formulas, and real examples.

Jan 29, 20267 min read
Read more
On-Page SEO

On-Page SEO Checklist: 15 Steps to Optimize Any Page

Follow this complete on-page SEO checklist to optimize any page for higher Google rankings. 15 actionable steps from title tags to internal links and beyond.

Mar 5, 202610 min read
Read more
On-Page SEO

SERP Preview: How to Optimize Your Google Search Appearance

Learn how to preview and optimize your Google search appearance. Improve title tags, meta descriptions, and URLs to maximize clicks from search results.

Mar 12, 20266 min read
Read more

Generate SEO Briefs 10x Faster

Stop spending hours on manual research. OneClickExperts uses AI to generate comprehensive, data-driven SEO content briefs in seconds.