How to Optimize WordPress Images for Faster Loading

Images are beautiful. They make your WordPress site engaging, professional, and compelling. They also make it slow — unless you optimise them.

On most WordPress websites, images account for 50–80% of total page weight. A single unoptimised hero image can weigh more than the rest of the entire page combined. Multiply that by dozens of images across a blog post or product gallery, and you have a site that crawls.

The good news: image optimisation is one of the most impactful and achievable performance improvements you can make to any WordPress site. This comprehensive guide covers every aspect of WordPress image optimisation — compression, resizing, format conversion, lazy loading, and more — with step-by-step instructions for each.

Why Image Optimisation Matters So Much

  • Images are the largest page weight contributor. The HTTP Archive's Web Almanac consistently shows that images account for the largest share of bytes transferred on the average web page — larger than HTML, CSS, JavaScript, and fonts combined.
  • Google measures image performance in Core Web Vitals. Your Largest Contentful Paint (LCP) score — one of Google's three Core Web Vitals ranking signals — is almost always determined by your hero image or the largest above-the-fold image. An unoptimised hero image is a direct hit to your Google ranking.
  • Visitors notice image load times. Even if a page's HTML loads instantly, a page that feels like it's popping in section by section as images load creates a poor experience. Properly optimised images load smoothly and quickly.
  • Faster images = lower hosting costs. Every byte of image data your server sends consumes bandwidth. Reducing image sizes directly reduces your bandwidth usage — and on metered hosting plans, your hosting bill.
01
Upload Images at the Correct Dimensions

Before optimisation even begins, the single most impactful thing you can do is upload images at the correct size — not at their original camera or design file dimensions.

The problem: A modern DSLR camera produces images at 5000px wide or larger. Your blog post content column is 800px wide at most. Uploading the 5000px original and letting WordPress display it at 800px means the browser downloads a file 6x larger than it needs to.

The fix: Resize images to approximately their display dimensions before uploading.

How to check display dimensions:

  1. Right-click an image on your site
  2. Select Inspect
  3. In the developer tools, hover over the <img> element
  4. It will show the rendered dimensions (e.g., "800 × 500") — this is the actual display size

Free tools to resize before uploading:

  • Squoosh (squoosh.app) — Browser-based, no installation, excellent quality control
  • IrfanView (Windows) — Free, handles batch resizing of multiple images
  • Preview (Mac) — Built-in, go to Tools → Adjust Size
  • GIMP — Free, open-source, full image editor

General dimension guidelines:

Image TypeRecommended Max Width
Full-width hero image1600px
Blog post featured image1200px
Blog post body image800px
Product image (WooCommerce)1000px
Thumbnail400px
Logo400px
Author avatar200px
Uploading at these dimensions before compression produces far better results than uploading at full size and relying on plugins to resize afterwards.
02
Choose the Right Image Format

Using the right file format for each type of image is one of the easiest ways to dramatically reduce file sizes without any visible quality loss.

JPEG (.jpg) — Best for photographs and images with many colours and gradients. Good compression, wide compatibility. Use for all photos.

PNG (.png) — Best for graphics, logos, screenshots, and images that require transparency. PNG is lossless but produces larger files than JPEG for photographs. Never use PNG for photos — use JPEG instead.

WebP — Google's modern image format. Produces files 25–35% smaller than JPEG at equivalent quality, with support for transparency. Supported by all modern browsers (Chrome, Firefox, Safari, Edge). This should be your default format for new images.

AVIF — Next-generation format, even smaller than WebP. Browser support is still catching up (Chrome and Firefox support it, Safari partially) — use as a progressive enhancement alongside WebP.

SVG — For logos, icons, and simple graphics. Vector-based, infinitely scalable with no quality loss, and typically very small file sizes.

GIF — Avoid unless you specifically need animation. For animated images, consider using short MP4 or WebM videos instead — they're dramatically smaller.

Quick format decision guide:

  • Photo of a person/product/place → JPEG or WebP
  • Logo or icon with transparency → SVG or PNG
  • Screenshot → PNG or WebP
  • Simple graphic/illustration → WebP or SVG
  • Animation → MP4 video (not GIF)
03
Compress Your Images

Even after resizing and choosing the right format, images can often be compressed further — removing metadata, redundant colour information, and optimising encoding — without any visible quality loss.

Compress Before Uploading (Manual):

  • Squoosh (squoosh.app) — The best free browser-based tool. Upload your image, choose your format (WebP recommended), adjust quality slider (80–85% is typically imperceptible from 100%), and download.
  • TinyPNG (tinypng.com) — Drag-and-drop, instant compression for PNG and JPEG. Free for up to 20 images at a time.
  • ImageOptim (Mac) — Desktop app that batch-processes images with exceptional lossless compression.

Compress After Uploading (Plugin):

These plugins process your existing Media Library and automatically compress new uploads going forward:

Smush (free tier — WPMU DEV)

  • Compresses images on upload automatically
  • Bulk compresses existing Media Library (free tier: unlimited images)
  • Lazy loading built in
  • Free tier limitation: no WebP conversion, no compression of images over 5MB

ShortPixel (freemium — 100 images/month free)

  • Excellent compression quality — three modes: lossy, glossy, lossless
  • WebP and AVIF conversion included
  • Bulk processes existing library
  • Best compression quality of the free-tier options

Imagify (freemium — 20MB/month free)

  • Made by the WP Rocket team
  • Three compression levels: normal, aggressive, ultra
  • WebP conversion
  • Integrates especially well with WP Rocket if you're using both

EWWW Image Optimizer (freemium)

  • No account required for basic use
  • Local compression (no external API — files don't leave your server)
  • Free tier handles unlimited images but without WebP conversion (paid plan adds WebP)
Recommendation: For most sites, ShortPixel (free tier) or Imagify provides the best compression quality. For enterprise or high-volume sites, a paid plan from either is worth the investment.
04
Convert Images to WebP

WebP images are 25–35% smaller than JPEG at equivalent visual quality. Switching your WordPress site to serve WebP images is one of the most impactful format changes you can make.

How to enable WebP in WordPress:

Most image optimisation plugins handle WebP conversion automatically:

  • ShortPixel: Settings → ShortPixel → WebP Images → enable "Create WebP versions"
  • Imagify: Settings → Imagify → Display WebP images on the site
  • EWWW Image Optimizer: Settings → WebP Conversion → enable
  • LiteSpeed Cache: Image Optimization → WebP Replacement

These plugins create WebP versions of all your images and serve them to browsers that support WebP, while automatically falling back to JPEG/PNG for older browsers.

Verify WebP is being served:

  1. Right-click an image on your site and select "Open image in new tab"
  2. Check the URL — if it ends in .webp, WebP is being served
  3. Alternatively, in Chrome DevTools → Network tab, filter by "Img" and check the "Type" column for images — it should show "webp"
05
Enable Lazy Loading

Lazy loading defers the loading of off-screen images until the user scrolls near them. Without lazy loading, every single image on your page loads immediately — including ones at the very bottom that most visitors never reach.

WordPress 5.5+ lazy loading:

WordPress added native lazy loading in version 5.5. All images automatically get the loading="lazy" attribute, which modern browsers respect natively — no plugin required.

Verify it's working by inspecting an image element and confirming the loading="lazy" attribute is present.

One critical exception — never lazy load your hero image:
The above-the-fold hero image should never be lazy loaded. Lazy loading it delays its appearance and directly hurts your LCP score. Most implementations are smart enough to skip the first image — but always verify your hero image doesn't have loading="lazy" on it.
06
Set Correct Image Dimensions in HTML

Every <img> tag in your page's HTML should have explicit width and height attributes set. This allows the browser to allocate the correct space for images before they finish loading — preventing layout shifts that hurt your CLS (Cumulative Layout Shift) score.

WordPress sets these automatically when you insert images through the block editor using standard image blocks. Problems occur with:

  • Images added via custom HTML blocks without dimensions
  • Images added via plugins that don't set dimensions
  • CSS-resized images where the HTML attributes don't match the display size

Check for missing dimensions:

In Google PageSpeed Insights, look for the "Image elements do not have explicit width and height" warning.

Fix in the block editor:

Click any image block → check the settings panel on the right → ensure width and height are set.

07
Serve Correctly Sized Images for Each Device

A desktop hero image displayed at 1400px wide doesn't need to be the same file served to a mobile phone displaying it at 380px wide. Serving identically sized images to all devices wastes bandwidth on mobile.

WordPress srcset — how it works:

WordPress automatically generates multiple image sizes when you upload (thumbnail, medium, large, and any custom sizes your theme defines) and outputs a srcset attribute on <img> tags listing all available sizes. Browsers automatically download the most appropriate size for the user's screen.

Ensure srcset is working:

Inspect any image on your site — it should have a srcset attribute listing multiple image URLs at different sizes. If it doesn't, your theme may be suppressing this.

Add custom image sizes (if needed):

If your theme needs image sizes that WordPress doesn't generate by default, add them in functions.php:

PHP
add_image_size( 'hero-mobile', 600, 400, true );
add_image_size( 'hero-desktop', 1400, 600, true );
Then regenerate thumbnails using the Regenerate Thumbnails plugin to create these sizes for existing images.
08
Use a CDN for Image Delivery

Serving images from a CDN dramatically reduces load times for visitors who are geographically distant from your server. A CDN caches your images on servers around the world — a visitor in Tokyo gets your images from a Tokyo server, not one in London.

Options:

  • Cloudflare (free) — Set up as a reverse proxy, serves all static files including images through its global network
  • BunnyCDN (affordable) — Excellent performance, easy WordPress integration
  • JetPack Site Accelerator (free) — Serves your images through WordPress.com's CDN automatically

Most performance plugins (WP Rocket, LiteSpeed Cache) include CDN integration settings where you enter your CDN URL and they automatically rewrite image URLs.

WordPress Image Optimisation Checklist

  • Resize images to correct display dimensions before uploading
  • Use JPEG or WebP for photos, PNG/SVG for logos and graphics
  • Compress images before uploading (Squoosh or TinyPNG)
  • Install an image optimisation plugin (ShortPixel or Imagify recommended)
  • Enable WebP conversion in your plugin settings
  • Bulk process existing Media Library images
  • Verify lazy loading is active on body images
  • Confirm hero/above-fold image is NOT lazy loaded
  • Check images have explicit width and height attributes
  • Verify srcset is being output for responsive images
  • Set up CDN for image delivery

Frequently Asked Questions

Q: How much file size reduction should I expect from image compression?
A: It varies by image type and content, but typical results are: JPEG compression saves 30–60% from originals, WebP conversion saves an additional 25–35% versus JPEG, and resizing to correct dimensions can save 70–90% on oversize uploads. A 4MB original photo can realistically become a 150–300KB WebP file with no perceptible quality loss.
Q: Will image compression reduce my image quality?
A: Lossy compression (JPEG, standard WebP) does technically reduce quality — but at the settings recommended here (80–85% quality), the difference is imperceptible to the human eye. Lossless compression (PNG, lossless WebP) produces identical quality. Always preview the compressed output before committing.
Q: Should I use an image optimisation plugin or manually compress before uploading?
A: Both is best. Manual compression before upload gives you control over quality. A plugin then catches anything you missed and handles future uploads automatically. For large existing media libraries, a plugin's bulk processing is essential.
Q: Does image optimisation affect my SEO?
A: Absolutely — and positively. Faster LCP (from optimised hero images) directly improves Core Web Vitals scores, which are a Google ranking factor. Smaller images also improve overall page speed scores. The only SEO-sensitive thing to maintain is your image file names and alt text — compression doesn't affect these.

Final Thoughts

Image optimisation is the most impactful performance improvement available to most WordPress sites. Start by resizing images to the correct display dimensions and switching to WebP format — these two changes alone can reduce your page weight by 60–80%. Then install an image compression plugin to automate the process going forward and bulk-process your existing media library.

The whole process can be completed in an afternoon — and the results will show immediately in your PageSpeed scores, your load times, and your user experience.

Need help auditing and optimising your WordPress site's images? Our performance team handles full image optimisation as part of our WordPress speed optimisation service.

Contact us today
Views: 92