How to compress images in WordPress

WordPress makes several copies of every image you upload and serves whichever fits. Getting this right is mostly about what you upload, not which plugin you install.

The short answer

Biggest win
Compress and resize before uploading. Nothing downstream fixes a bloated original.
Upload width
2000 px on the longest edge is plenty for almost every theme.
Built-in scaling
WordPress scales uploads above roughly 2560 px automatically.
Thumbnails
Every registered size is generated for every upload — themes often add many.
WebP
Uploads are supported; conversion of existing images needs a plugin.
Plugins
Useful for bulk conversion and delivery, not a substitute for step one.

The order to do things in

  1. Step 1: Compress before you upload

    Resize to about 2000 pixels on the longest edge and compress at quality 80 before the file ever reaches WordPress. This is the step that matters most, because every derivative WordPress generates is made from what you gave it.

  2. Step 2: Set your media sizes deliberately

    In Settings → Media, set the thumbnail, medium and large dimensions to values your theme genuinely uses. Then check which additional sizes your theme and plugins register — it is common to find a dozen, each generated for every single upload.

  3. Step 3: Serve WebP

    WordPress accepts WebP uploads directly. To convert an existing library you need a plugin, which will typically also handle serving WebP to browsers that support it and the original to those that do not.

  4. Step 4: Check what is actually being served

    Open a page, use your browser's network panel, and sort by size. You will usually find one or two images doing most of the damage — often a header or a background that nobody thought to optimise.

Details worth knowing

Why uploading a camera original is expensive

When you upload an image, WordPress generates a copy at every registered size. A default install creates a few; an average theme with a page builder can register a dozen or more, and plugins add their own.

So a single 8 MB upload does not cost 8 MB — it costs 8 MB plus every derivative, all generated from that oversized source, all sitting in your uploads folder forever. Multiply by a few hundred posts and the media library becomes the largest thing in your backups.

Uploading a sensibly sized file makes every one of those copies cheaper at once.

The automatic scaling threshold

Modern WordPress scales very large uploads down automatically, keeping the original as a separate file and using the scaled version as the "full" size. The threshold sits at roughly 2560 pixels.

This is a sensible safety net, but it is not optimisation: the scaled file is still re-encoded from a huge source at whatever quality WordPress chooses, and the original is retained on disk. Doing the resize yourself gives a better result and does not leave a copy behind.

Which image is actually being served

WordPress outputs a srcset listing the available sizes, and the browser picks based on the layout and the screen. This is genuinely good behaviour — it means a phone downloads a small file — but it only works if the appropriate sizes exist.

Two common failures: a theme that outputs the full-size image directly in a template, bypassing srcset entirely; and a page builder that sets a background image in CSS, where responsive images do not apply at all. Both show up immediately in the network panel.

What plugins are and are not for

An optimisation plugin is worth having for two things: converting an existing library to WebP in bulk, and serving the right format to each browser. Some also offload delivery to a CDN, which is a separate and often larger win.

What a plugin cannot do is make a badly chosen original good. Compression is lossy — a plugin re-compressing your already-compressed upload is adding a second lossy pass, not recovering anything. Get step one right and the plugin has an easy job.

Be wary of plugins that compress by uploading your images to the vendor's servers, particularly if the site handles anything sensitive. That is a data-processing relationship, not just a plugin.

Housekeeping worth doing once

  • Disable image sizes your theme does not use, so new uploads stop generating them.
  • Regenerate thumbnails after changing sizes, or old posts keep pointing at the old files.
  • Set explicit width and height on images so the browser reserves space and the page does not jump as it loads.
  • Leave lazy loading on for images below the fold, and off for your hero image — lazy-loading the largest visible element delays the very thing your page speed is measured on.

One caveat

Menu names and options move between releases. If a step below does not match what you see, the underlying capability is usually still there under a nearby name — and the browser tool on this page works identically on every version.

Do it here instead

These run in your browser on any device, so nothing is uploaded and there is nothing to install.

  • Bulk compressor

    One setting across a whole folder, processed in parallel, downloaded as a ZIP.

    Open the tool
  • JPG to WebP

    Typically 25–35% smaller at matched quality. The standard web win.

    Open the tool
  • Resize image

    By pixels or percentage, aspect ratio locked, across a whole batch.

    Open the tool
  • Compress to 200KB

    Full resolution kept, quality still invisible to the eye.

    Open the tool

Questions

Frequently asked questions

Every answer below is present in the page source, expanded, so it can be read without opening anything.

Should I compress images before or after uploading to WordPress?

Before, always. WordPress generates a copy at every registered size from whatever you upload, so an oversized original multiplies into a dozen oversized derivatives. Compressing afterwards means a second lossy pass over files that were already made badly.

What size should I upload?

About 2000 pixels on the longest edge suits almost every theme, including full-width layouts on high-density screens. Combined with quality 80 that is typically 200–400 KB, from which WordPress can generate every smaller size it needs.

Do I need an image optimisation plugin?

Only for jobs you cannot do at upload time: converting an existing library to WebP in bulk, and serving the right format per browser. If you compress properly before uploading, a plugin adds much less than its marketing suggests.

Does WordPress support WebP?

Yes, you can upload WebP files directly and use them like any other image. Converting an existing library, and serving WebP with a fallback for older clients, is what a plugin is for.

Why is my WordPress site still slow after compressing images?

Check what is actually being downloaded in the browser's network panel. Common culprits are a CSS background image that bypasses responsive sizing, a theme template outputting the full-size file, a slider loading every slide at once, or an unoptimised web font. Images are usually the biggest cost, but not always the only one.

Should I delete the original uploads to save space?

Be careful. WordPress keeps the original so it can regenerate sizes later — delete it and changing your theme means re-uploading everything. Reducing the number of registered sizes is the safer way to reclaim disk space.

From the blog

Related reading

More background from the blog.

  • Practical Guides

    How to Compress Images for a Website Without Wrecking Them

    Resize before you compress. Measured on one photograph: half the width at quality 80 produced a 16.4 KB file, while full width at quality 40 produced 20.6 KB and looked far worse. The order of operations matters more than the settings.

    8 min read

  • Image Formats

    WebP vs JPEG: Which Should You Use, and When JPEG Still Wins

    WebP produced a 27.0 KB file against MozJPEG's 41.1 KB on the same photograph at slightly higher measured fidelity — 34% smaller. It also produced a larger file than JPEG on random noise. The advantage is real and content-dependent.

    9 min read

  • Image Compression

    JPEG Quality Settings Explained: What the Number Actually Means

    Quality 80 is not 80% of anything. It is an index into a quantisation table. Measured on one photograph: dropping from 100 to 90 removes 77% of the file and 4.2 dB of fidelity; dropping from 40 to 30 removes 17% and costs almost as much.

    8 min read