How to Compress Images in WordPress

Unoptimized images are the leading cause of slow WordPress sites. A camera photo uploaded directly to WordPress can be 5 to 15 MB — and WordPress, by default, doesn't compress the original, it only creates resized copies. The result is pages that take forever to load, low PageSpeed scores and damaged SEO.

There are two moments to intervene: before uploading (compress locally) and after uploading (use plugins). This guide covers both.

Two ways to fix WordPress images Before upload (local) Compress in the browser, then upload ✓ No plugin, no monthly limit ✓ Original stays light forever ✓ Full control over quality ✓ Works on any host Best for new content After upload (plugin) Optimize automatically inside WordPress ✓ Fixes images already uploaded ✓ Automatic on future uploads ✓ Bulk-optimize old libraries ⚠ Free plans have monthly limits Best for existing libraries
Combining both gives the cleanest long-term result.

Why WordPress doesn't fix it automatically

WordPress generates resized copies of each image you upload (thumbnail, medium, large), but compresses them at a default quality of 82% and only in JPG — without touching the original, without automatic WEBP conversion (until WordPress 6.5), and without advanced optimization. This means if you uploaded an 8 MB photo, the 8 MB original still sits in your media library — and depending on the theme, it may be served directly on pages instead of the smaller versions.

Method 1: compress before uploading (most efficient)

The most efficient approach is compressing images before uploading to WordPress. This ensures:

  • The original is already optimized — no heavy version stored on the server
  • You have full control over quality level
  • You don't depend on any plugin working correctly

Step by step:

  1. Open TinyFoto
  2. Drag the images you're going to upload to WordPress (batch mode — up to 30 at once)
  3. Choose Medium level for blog/site use (ideal balance)
  4. If you want WEBP (recommended for WordPress 5.8+), select "Convert to WEBP" in the Format field
  5. Download and upload to WordPress normally

Target file weight by image type in WordPress:

  • Post featured image: under 150 KB
  • In-content photo: under 200 KB
  • Hero banner: under 300 KB
  • Category thumbnail: under 80 KB

Method 2: image optimization plugins

To optimize images already uploaded or automate compression for future uploads, plugins are the solution. The most widely used:

Imagify

One of the most complete options. Compresses JPG, PNG and GIF, automatically converts to WEBP, and has a generous free quota (25 MB/month). The paid version has no limits. It includes a Bulk Optimization feature for optimizing your entire existing media library at once.

ShortPixel

Popular and reliable. Offers three modes: Lossy (smaller result), Lossless (no quality loss) and Glossy (in between). Free plan with 100 images/month. Also converts to WEBP and has bulk optimization.

Smush

Free plugin from WPMU Dev with no image limit on the free version. Automatically performs lossless compression on upload and includes bulk optimization. The Pro version adds WEBP conversion and integrated lazy loading.

WebP Express

Plugin specifically for converting JPG/PNG to WEBP, using the server's own conversion function (GD or Imagick). Useful when you just want to add WEBP without changing your existing compression workflow.

WEBP in WordPress: how it works

Since WordPress 5.8 (2021), WordPress supports native WEBP uploads. If you upload a WEBP, it's served directly — no additional conversion. For sites with hosting plans that support mod_rewrite (Apache) or the NGINX equivalent, plugins like Imagify or ShortPixel configure rules to automatically serve WEBP to compatible browsers, keeping JPG/PNG as fallback.

The simplest way to take advantage of WEBP in WordPress without plugins is to compress and convert to WEBP before uploading — as explained in Method 1.

Target weights in WordPress Bars are proportional to recommended KB ceiling Thumbnail < 80 KB Featured image < 150 KB In-content photo < 200 KB Hero banner < 300 KB
Stay under these ceilings and PageSpeed will stop complaining about images.

How to check if images are hurting your site

Use Google PageSpeed Insights (search for it on Google or go to pagespeed.web.dev). Enter your site URL and look at the recommendations. The most common image-related ones are:

  • "Serve images in next-gen formats" — you're not using WEBP
  • "Properly size images" — you're serving images larger than necessary
  • "Defer offscreen images" — lazy loading isn't configured
  • "Efficiently encode images" — files aren't compressed

Frequently asked questions

Should I optimize images before or after uploading to WordPress?

Ideally both. Compress before uploading to ensure the original is already optimized. Use a plugin to automate future uploads and to re-optimize images already in your library.

Does using a compression plugin slow WordPress down?

The most popular compression plugins (Imagify, ShortPixel) process images asynchronously on their own servers — they don't impact page load times. Only the upload moment may be slightly slower.

What's the difference between lossy and lossless in WordPress?

Lossless discards no data — the file gets smaller but by less (10–30%). Lossy discards imperceptible data — 50–80% reduction with visually identical results on screen. For most websites, lossy at medium level is the best choice.

I have 500 old unoptimized images in WordPress. What should I do?

Use the Bulk Optimization feature in any plugin like Imagify, ShortPixel or Smush. They process the entire media library in batch mode. Depending on your hosting and plugin plan, this may take a few minutes.

Compress images for WordPress →