Image SEO Secrets: Alt Text, Compression, and Modern Formats for Faster Loading

Image SEO is the discipline of making every image on your site readable to search engines, fast for users, and optimised for Google Images — and most sites get at least half of it wrong. Missing or meaningless alt text, images three times larger than they need to be, outdated file formats that add unnecessary bytes — these are silent performance killers that slow your page speed, tank your Core Web Vitals, and leave Google without the context it needs to index your visual content. This guide covers every practical step of image SEO: writing alt text that works, choosing the right modern format, compressing without sacrificing quality, sizing images correctly, and adding the structured data that unlocks rich results.

The payoff is twofold — faster pages that rank better and a presence in Google Images that drives an entirely separate traffic stream. Both are achievable without specialist tools or a developer, starting today.

What you will learn

This guide covers writing effective alt text, choosing between WebP, AVIF, JPEG, and PNG, compressing images for the web, sizing and serving images responsively, implementing lazy loading, naming image files for SEO, and adding ImageObject structured data to improve your presence in Google Images and rich results.

Step 1: Write Alt Text That Works for Search and Accessibility

Alt text — the alt attribute on an <img> tag — serves two purposes: it describes an image to screen readers used by people with visual impairments, and it tells search engines what an image depicts so it can be indexed and ranked in Google Images. Both matter. An image with no alt text is invisible to Googlebot and inaccessible to screen reader users simultaneously.

What makes alt text effective for SEO

Good alt text is specific, descriptive, and naturally includes relevant keywords without stuffing them in artificially. It describes what is actually in the image — not what you wish the image was, not a list of keywords, not a repetition of the page title. Think of it as what you would say to someone on the phone who cannot see the image but needs to understand it.

Poor alt text — empty
alt=""
Poor alt text — keyword stuffed
alt="SEO SEO tips image SEO guide best SEO"
Poor alt text — vague filename
alt="image001.jpg"
Good alt text — descriptive and specific
alt="Screenshot of Google Search Console showing a Core Web Vitals report with mobile LCP flagged as Poor"
Good alt text — natural keyword inclusion
alt="Comparison of WebP versus JPEG image quality and file size for web performance optimisation"

When to use empty alt text deliberately

Purely decorative images — dividers, background patterns, abstract design elements that convey no information — should use an empty alt attribute: alt="". This signals to screen readers that the image can be safely skipped, and tells Google not to index it as meaningful content. The mistake is leaving out the alt attribute entirely — an absent attribute is different from an empty one and is treated as an error by accessibility validators.

Never use the image filename as alt text

WordPress and some other CMSs auto-populate alt text from the filename if you forget to add it — so IMG_4821.jpg becomes alt="IMG_4821". This is meaningless to both users and Google. Always write a genuine description. Audit your image alt text periodically using the SEOGuy SEO Analyzer to flag pages where images are missing descriptive alt attributes.

Step 2: Choose the Right Image Format

The format you save your image in is one of the biggest determinants of file size — and therefore load time. Most sites in 2026 should be serving the majority of their images in WebP or AVIF, yet many still default to JPEG and PNG for everything. Each format has a specific best use case.

AVIF
Modern — Best

Outstanding compression — often 50% smaller than JPEG at the same quality. Supported by all major browsers. Best choice for photographs and complex images where maximum compression matters.

WebP
Modern — Recommended

25–35% smaller than JPEG at equivalent quality. Supports transparency like PNG. Excellent browser support. The safe default for most web images when AVIF encoding is not available.

SVG
Modern — Vector

Resolution-independent vector format. Ideal for logos, icons, illustrations, and any graphic that needs to scale without quality loss. Tiny file sizes for simple graphics.

JPEG / JPG
Legacy — Acceptable

Widely supported but larger than WebP or AVIF at the same quality. Use as a fallback for browsers that do not support modern formats — serve via <picture> element.

PNG
Legacy — Limited Use

Lossless format with transparency support. Produces very large files for photographs. Only appropriate for images that require pixel-perfect fidelity — screenshots with fine text, for example.

GIF
Avoid

Outdated format with limited colour depth and very large file sizes for animations. Replace animated GIFs with video (<video autoplay loop muted playsinline>) for dramatically smaller files.

Serving modern formats with the picture element

Browser support for AVIF is now excellent, but using a <picture> element provides a JPEG fallback for any edge case. The browser picks the first format it supports.

Modern format delivery with <picture> fallback
<picture>
  <source srcset="hero-image.avif" type="image/avif">
  <source srcset="hero-image.webp" type="image/webp">
  <img
    src="hero-image.jpg"
    alt="Descriptive alt text describing the image content"
    width="800" height="450"
    loading="lazy"
  >
</picture>

Step 3: Compress Images Without Losing Quality

Compression reduces file size by removing data that the human eye cannot easily detect. Done correctly, a compressed image is visually indistinguishable from the original while being 40–80% smaller in bytes. That size reduction translates directly into faster load times, better LCP scores, and lower bandwidth costs.

Lossy versus lossless compression

Lossy compression permanently removes some image data to achieve smaller files — appropriate for photographs and complex imagery where minor quality reduction is imperceptible. Lossless compression removes only redundant metadata without affecting image quality — used for screenshots, diagrams, and text-heavy images where every pixel matters. Most web images benefit from lossy compression at a quality setting between 75 and 85 for JPEG, or equivalent for WebP and AVIF.

Recommended compression tools and settings
  • Squoosh (squoosh.app) — free browser-based tool from Google; supports AVIF, WebP, JPEG, PNG; full control over quality settings
  • Sharp (Node.js library) — programmatic compression for automated pipelines; handles batch processing at scale
  • ImageOptim (Mac) — drag-and-drop lossless compression for PNG and JPEG; removes metadata including GPS coordinates
  • Cloudflare Image Resizing / Cloudinary — CDN-level automatic conversion and compression; serves the right format and size per device automatically
  • WordPress plugins — EWWW Image Optimizer, ShortPixel, and Imagify compress and convert images on upload and retroactively on existing media

Target file sizes by image type

Image Use Target File Size Format
Hero / featured image Under 150 KB WebP or AVIF
In-content blog images Under 80 KB WebP or AVIF
Product images (e-commerce) Under 120 KB WebP or AVIF
Thumbnails / card images Under 30 KB WebP or AVIF
Author avatars / icons Under 15 KB WebP or SVG
Logos and icons Under 5 KB SVG preferred
Pro tip — strip EXIF metadata

JPEG files often contain EXIF metadata — camera make and model, GPS location, colour profile, timestamps — that adds between 10 KB and 100 KB to the file size with no benefit to the user or search engine. Most compression tools strip this automatically, but verify it is happening. Removing EXIF data from a batch of photographs can meaningfully reduce total page weight across an image-heavy site.

Step 4: Resize Images to Their Actual Display Dimensions

Compression alone is not enough if the image dimensions are wrong. An image that displays at 800 pixels wide on desktop but is saved at 3,000 pixels wide is making the browser download three times more data than it needs. Resizing — setting the physical pixel dimensions to match or be slightly larger than the maximum display size — is the single most impactful change you can make to image performance.

The rule: save at 2× the CSS display size for retina screens

If an image displays at 800px wide in your layout, save it at 1,600px wide to look sharp on high-density (retina/HiDPI) screens. Anything larger is wasted data. For a typical blog post image with a prose column of 740px, save images at 1,480px wide maximum — not 3,000px, not 5,000px.

Always declare width and height attributes

Omitting the width and height attributes on <img> tags causes layout shift — the page reflows as the image loads, pushing content up and down. This directly inflates your CLS (Cumulative Layout Shift) Core Web Vitals score and degrades the user experience. Always include width and height matching the image's intrinsic pixel dimensions, even when using CSS to control the display size.

Step 5: Serve Responsive Images with srcset and sizes

A single image URL serves the same file to a 375px smartphone and a 2560px desktop monitor. Responsive images fix this by telling the browser which image file to use at each screen width — so mobile users get a small, fast file, and desktop users get a high-resolution one. This is the srcset and sizes attribute system.

Responsive image with srcset — full implementation
<img
  src="blog-image-800w.jpg"
  srcset="
    blog-image-400w.webp  400w,
    blog-image-800w.webp  800w,
    blog-image-1200w.webp 1200w,
    blog-image-1600w.webp 1600w
  "
  sizes="
    (max-width: 600px)  calc(100vw - 32px),
    (max-width: 1060px) calc(100vw - 64px),
    740px
  "
  alt="Descriptive alt text for the image"
  width="800"
  height="450"
  loading="lazy"
>

The srcset attribute lists the available image files and their pixel widths. The sizes attribute tells the browser how wide the image will actually appear at each viewport width. The browser combines both to pick the most efficient file to download — often dramatically reducing data usage on mobile.

  • 1
    Generate multiple sizes of each image
    For a typical blog post image, create versions at 400px, 800px, 1200px, and 1600px wide. Tools like Sharp, Cloudinary, or a WordPress plugin with responsive image generation handle this automatically on upload. Manually, use Squoosh or any image editor that allows export at specified widths.
  • 2
    Write accurate sizes values for your layout
    The sizes attribute is the piece most developers get wrong — a generic 100vw value tells the browser the image fills the full viewport, so it downloads a large file even on mobile. Measure your actual layout: if the image column is 740px wide on desktop and full-width minus 32px padding on mobile, write those values explicitly.
  • 3
    Use your CMS's built-in responsive image handling
    WordPress automatically generates multiple sizes and adds srcset markup for images uploaded through the media library since version 4.4. Verify this is working on your theme by inspecting the HTML of any in-content image. If srcset is absent, your theme may be overriding core image output — check with your theme developer or use a plugin to restore it.

Step 6: Use Lazy Loading Correctly

Lazy loading defers the download of images that are not currently visible in the user's viewport. Instead of the browser downloading every image on the page the moment it starts loading, off-screen images are fetched only as the user scrolls toward them. This can dramatically reduce initial page load time and LCP for pages with many images.

Native lazy loading — add to below-the-fold images
<!-- Hero / above-the-fold image: EAGER (default) -->
<img src="hero.webp" alt="..." loading="eager" fetchpriority="high">

<!-- Below-fold images: LAZY -->
<img src="section-image.webp" alt="..." loading="lazy">
Never lazy-load the hero image

The Largest Contentful Paint (LCP) element on most pages is the hero image — the largest image visible when the page first loads. Adding loading="lazy" to the hero image delays its download, which directly and significantly hurts your LCP score. The hero image should always use loading="eager" (or no loading attribute at all, since eager is the default) and should be paired with fetchpriority="high" to tell the browser to prioritise it above other resources.

Step 7: Name Your Image Files for SEO

Google reads image filenames as a signal about image content — they contribute to how images are categorised and ranked in Google Images. A filename like DSC00421.jpg tells Google nothing. A filename like on-page-seo-checklist-for-beginners.webp reinforces the image's topic and the page's keyword focus simultaneously.

Image file naming rules

  • Use descriptive, lowercase words separated by hyphens — never underscores or spaces
  • Include the primary keyword naturally — not stuffed, not repeated
  • Keep it concise: three to six words is typically enough to be descriptive
  • Match the filename to what the image actually shows — not just the page topic
  • Rename files before uploading — renaming after upload creates broken links unless you update references
File naming examples — before and after
Before (Poor) After (Good)
IMG_4812.jpgkeyword-research-process-diagram.webp
photo.pnggoogle-search-console-coverage-report.webp
image001.jpginternal-linking-hub-spoke-model.webp
screenshot-2.pngmeta-tag-generator-tool-interface.webp
FINAL_v3_COMPRESSED.jpgmobile-first-indexing-viewport-settings.webp

Step 8: Add Structured Data for Images

ImageObject structured data in JSON-LD helps Google understand the context of your images — who created them, what they depict, and what page they belong to. On pages where an image is central to the content (a recipe, a product, an article), properly implemented image schema can unlock rich results in Google Images, including licence information, creator attribution, and featured image treatment in search results.

Use the SEOGuy Schema Markup Generator to create valid JSON-LD schema for your pages, including ImageObject properties within your BlogPosting or Article schema. This ensures your images are correctly attributed and eligible for enhanced presentation in Google Images and Google Discover.

ImageObject within BlogPosting schema — JSON-LD example
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Image SEO Secrets: Alt Text, Compression, and Modern Formats",
  "image": {
    "@type": "ImageObject",
    "url": "https://yourdomain.com/images/image-seo-guide.webp",
    "width": "1200",
    "height": "675",
    "caption": "Complete image SEO guide covering alt text, compression, and modern formats"
  },
  "author": {
    "@type": "Organization",
    "name": "SEOGuy.Online"
  },
  "datePublished": "2026-05-27"
}
</script>

Image-specific signals that improve Google Images ranking

  • Surrounding text context — the paragraph text immediately before and after an image is one of the strongest signals Google uses to understand what an image shows
  • Page topic relevance — an image of a line graph on a page about analytics rankings higher in Google Images searches related to analytics
  • Site authority — images from high-authority pages rank better in image search, just as pages rank better with more backlinks
  • Image caption — the <figcaption> element below an image is read by Google as direct context for the image; use it where it adds genuine value
  • Structured dataImageObject schema provides explicit signals about the image's content, creator, and licence

Check Your Pages for Image SEO Issues

Missing alt text, oversized images, and broken image references are among the most common technical issues found during an SEO audit. Run the free SEOGuy SEO Analyzer on your key pages and fix the issues that are slowing down your rankings.

Run a Free SEO Audit

Tools You Can Use on SEOGuy.Online

These free tools help you audit pages for image issues, optimise meta tags on image-heavy pages, and add structured data that improves image visibility in search results:

Key Takeaways

Image SEO — complete summary
  • Alt text must describe what is actually in the image — specific, natural, and keyword-relevant where appropriate; never empty (unless decorative), never keyword-stuffed
  • Decorative images should use alt="" (empty attribute present) — omitting the attribute entirely is treated as an error by accessibility validators and SEO auditors
  • AVIF is the best modern format for photographs — 50% smaller than JPEG at the same quality; WebP is the safe second choice with wider fallback support
  • Use the <picture> element to serve AVIF with WebP and JPEG fallbacks for maximum compatibility without sacrificing performance for modern browsers
  • Compress images to target sizes: hero images under 150 KB, in-content images under 80 KB, thumbnails under 30 KB — always in a modern format
  • Resize images to a maximum of 2× their CSS display width — serving 3,000px images in an 800px column is one of the most common and costly image performance mistakes
  • Always declare width and height attributes on every <img> tag — they prevent layout shift and protect your CLS Core Web Vitals score
  • Use srcset and sizes to serve appropriately sized images to every device — mobile users should never download a desktop-resolution image
  • Add loading="lazy" to all below-the-fold images and fetchpriority="high" to the hero image — never lazy-load the LCP element
  • Name image files descriptively with hyphens: google-search-console-coverage-report.webp, not IMG_001.jpg
  • ImageObject JSON-LD schema and accurate surrounding text context are the strongest signals for ranking in Google Images
  • Strip EXIF metadata from photographs on export — it adds unnecessary kilobytes with no benefit to users or search engines

Image SEO is one of those disciplines where every improvement compounds — faster pages rank better, rank better in Google Images, and deliver a better experience that keeps visitors engaged longer. Implementing the image SEO secrets in this guide across your existing content is a high-return investment that pays off in both organic search rankings and Core Web Vitals performance.


Frequently Asked Questions

Alt text influences rankings in two ways. First, it helps your images rank in Google Images, which is a separate source of traffic. Second, alt text contributes to the overall topical relevance signals on your page — Google reads it as part of the page's content, so descriptive alt text reinforces the keyword themes of your article. However, alt text alone is not a dominant ranking factor for the main organic results; it is one signal among many. Its most direct impact is on image search rankings and accessibility compliance.
AVIF produces smaller files than WebP at the same visual quality — typically 30–50% smaller than equivalent WebP images. For maximum performance, AVIF is the better choice. However, WebP encoding is faster, more widely supported by image editing tools, and has been the standard for several years with very broad browser support. The safest approach for most sites is to serve AVIF as the primary format with a WebP fallback using the picture element — this gives modern browsers the best performance while ensuring older browsers still receive an optimised image.
In WordPress, alt text can be added in two places. When inserting an image in the block editor (Gutenberg), click on the image block and find the "Alternative Text" field in the right sidebar panel. For images already in your Media Library, go to Media → Library, click on an image, and edit the "Alternative Text" field there. Alt text entered in the media library becomes the default for that image wherever it is used, but can be overridden per-instance in the block editor. Audit existing images regularly — many older posts have images with no alt text added during the early days of WordPress or after a migration.
Converting to WebP is safe for almost all use cases in 2026 — all major browsers (Chrome, Firefox, Safari, Edge) have supported WebP for years. The most common risk is if you have hardcoded image URLs in HTML or CSS referencing specific filenames with a .jpg extension — if you replace the file but not the reference, you get a broken image. The safest approach on WordPress is to use a plugin like ShortPixel or EWWW Image Optimizer that converts images server-side and serves WebP versions automatically without changing your original files or any URLs, using browser-level content negotiation to deliver the right format to each visitor.
There are two reliable methods. First, add a robots meta tag to the page containing the image with the value noindex — this prevents the entire page from being indexed, including its images. Second, block Googlebot-Image specifically in your robots.txt file by adding a User-agent: Googlebot-Image directive with the appropriate Disallow rules for the directories containing the images you want excluded. Note that blocking Googlebot-Image in robots.txt prevents image indexing but does not remove already-indexed images — use the URL Removal Tool in Google Search Console to request removal of specific image URLs already in the index. Use the SEOGuy Robots.txt Generator to build your robots.txt configuration without syntax errors.

SEOGuy Editorial Team
SEO Strategists & Content Team at SEOGuy.Online

The SEOGuy Editorial Team produces practical, research-backed SEO guides for website owners, marketers, and developers. Our content is written to help real people solve real SEO problems — no fluff, no filler.