Images are usually the heaviest part of a page, and the part visitors wait for. WordPress already does a lot automatically: it scales huge photos, creates several sizes and serves the right one with srcset. A couple of settings decide how big those files are.
What WordPress does with an upload
When you upload a photo, WordPress:
- Scales it if either side is wider than 2560 pixels, keeping your original as a backup.
- Creates smaller sizes: thumbnail, medium, large and any your theme adds.
- Compresses JPEGs at quality 82, a good balance between size and visible quality.
- Picks the right size per screen with
srcset, so phones don’t download desktop images.
New in WordPress 7.1: processing in the browser
WordPress 7.1 can now do that resizing and compression in the editor, in your browser, using a WebAssembly build of the libvips image library, before the file reaches the server. When the browser can’t, WordPress falls back to the server as before, with nothing for you to do.
For you this means faster uploads on slow hosts, AVIF support even when your server’s GD or Imagick can’t handle it, and iPhone HEIC photos that turn into JPEGs automatically. The quality and format filters below still apply, because the browser follows the same WordPress settings.
Step 1: choose a format
| Format | Size vs JPEG | Browser support | Good for |
|---|---|---|---|
| JPEG | baseline | every browser | fallback only |
| WebP | about 25–35% smaller | every current browser | most sites |
| AVIF | often smaller than WebP | every current browser | photo-heavy sites |
| PNG | much larger for photos | every browser | screenshots, logos with sharp edges |
WebP is the safe choice for almost every site. AVIF usually produces smaller files at the same quality but takes longer to encode. With 7.1’s in-browser processing that cost moves to the editor’s computer, so it’s more practical than it used to be.
Step 2: switch new uploads to WebP
Want AVIF instead? Change image/webp to image/avif in the snippet. If your server can’t encode AVIF and the editor’s browser can’t either, WordPress keeps the original format, so nothing breaks.
The WordPress Performance Team’s Modern Image Formats plugin does the same with a setting under Settings → Media, picks AVIF automatically when your server supports it, and can also output JPEG fallbacks.
Step 3: leave quality alone (mostly)
Quality 82 is a sensible default for JPEGs. Lowering it saves a little more, but text and gradients in screenshots start to show blocky artefacts. If you do change it, test with your real photos:
A good rule: below 75, savings get small and artefacts get visible.
Step 4: tune the size threshold
If your theme never shows images wider than, say, 1600 pixels, there’s no need to keep a 2560-pixel scaled copy:
And drop the generated sizes your theme never uses, so each upload creates fewer files:
Check the result
Upload a new JPEG and open it in Media → Library. The file address of the sizes ends in .webp (or .avif). On the front end, the browser’s Network tab shows the smaller format for that image.
Uploads are still JPEG3 common fixes
- Older images don’t change. Only new uploads are converted. Use a “regenerate thumbnails” plugin or
wp media regeneratefor the rest. - Your server can’t write WebP. Check Tools → Site Health → Info → Media Handling. Ask your host to enable WebP in GD or Imagick.
- A CDN or optimisation plugin converts images too. Pick one tool for conversion, or files get compressed twice.
Summary
Keep quality 82 and the 2560-pixel threshold unless you have a reason. Switch new uploads to WebP with one snippet, or AVIF if your images are mostly photos. Remove sizes your theme doesn’t use, and regenerate older images when you have time.
Check your understanding
Was this helpful?
Sorry about that. What was missing?
Thanks for your feedback!

