Compress

Compress JPGCompress PNGCompress WebPCompress AVIFCompress to 100 KBCompress to 200 KBCompress to 500 KB

Convert

Convert to JPGConvert to PNGConvert to WebPConvert to AVIFWebP to JPGPNG to JPGJPG to PNGWebP to PNG

Image tools

Crop ImageResize ImageImage to PDFImage to Base64

More tools

AI Prompt GeneratorColor PickerTime Zone ConverterQR Code GeneratorWord CounterPassword Generator
Web Performance

Image Compression for WordPress: A Practical Guide

WordPress does some optimisation automatically, but it cannot fix oversized originals. Here is what core handles and what is still your job.

What WordPress already does

Recent versions of WordPress include several helpful behaviours:

  • Responsive images: multiple sizes are generated and added to the image markup as srcset, so browsers can choose an appropriate file.
  • Lazy loading: images get loading="lazy" by default (since WordPress 5.5), with the first content image excluded.
  • Big image threshold: uploads wider than 2560 pixels are scaled down, and the original is kept separately.
  • WebP: WordPress 5.8 added support for uploading and using WebP images, as long as the server's image library supports it.
  • Default JPEG quality: sub-sizes are re-encoded at quality 82 by default.

These features reduce the damage but do not replace a good source file. A 6 MB upload still costs storage and slows the editor, and the “full” size is still large.

Step 1: Resize before uploading

Check your theme's content width and the widest place the image appears. For many themes that is 1200–1600 pixels. Resize to about that width, or double it if you want crisp results on high-density screens. Use the image resizer for batches, and the crop tool to remove empty space or match an aspect ratio.

Step 2: Choose the format

  • Photos: WebP, or JPEG if your host or plugins do not support WebP.
  • Logos and graphics: PNG, SVG or lossless WebP.
  • Transparent images: PNG or WebP.

Convert with the WebP converter. Make sure your host can process WebP before you rely on it; WordPress notes this requirement for the media library. See the format comparison for the trade-offs.

Step 3: Compress to a sensible quality

Because WordPress re-encodes sub-sizes, uploading a heavily compressed JPEG and then letting WordPress recompress it can stack losses. A practical approach is to upload a moderately compressed file (JPEG quality around 85 or WebP around 80) so the final quality stays good. Compress with the JPG compressor or WebP compressor.

Step 4: Add useful alt text and filenames

Google's image guidance recommends descriptive filenames, meaningful alt text and placing images near relevant text. Name the file red-running-shoes-side-view.webp rather than IMG_4021.webp, and write alt text that describes what the image shows.

Step 5: Protect your Largest Contentful Paint

The hero image is often the LCP element. Do not lazy-load it, make sure it has width and height set, and keep its file small. Full detail in image optimisation for Core Web Vitals.

Plugins and automation

Optimisation plugins can automate compression and format conversion on upload. They are worth considering for large libraries, but check what they do to your originals, whether they send images to an external service (a privacy consideration) and what happens if you deactivate them. Pre-optimising before upload works with any host and any theme.

Troubleshooting common WordPress image problems

  • Upload fails or “HTTP error”: the file may exceed your host’s upload limit or the server may run out of memory while creating sizes. Resize and compress before uploading.
  • WebP will not upload or generate sizes: the server’s image library may not support it. Ask your host or keep JPEG.
  • Blurry images on phones: you may have uploaded too small a file. Provide about twice the display width for high-density screens.
  • Media library is huge: remove unused originals and generate fewer intermediate sizes if your theme does not use them.

Measuring the result

After optimising, test a few key pages in PageSpeed Insights and check the Core Web Vitals report in Google Search Console after enough real traffic has accumulated. Look at LCP in particular, because it is often an image. If the LCP element is your featured image, make sure it is not lazy-loaded.

A pre-upload checklist

  1. Crop and resize to the display width.
  2. Convert to WebP or JPEG at quality 75–85.
  3. Check the file size (aim for the smallest that looks right).
  4. Rename the file descriptively.
  5. Upload, add alt text, and test on mobile.

For the underlying theory, read the image compression guide.

Try it now: Resize Image

Free, private and runs in your browser. Nothing is uploaded.

Open Resize Image

Frequently asked questions

It re-encodes generated sizes (default JPEG quality 82) and scales very large uploads, but it does not optimise the original thoroughly. Compress before uploading.
Yes, since WordPress 5.8, provided your server’s image library supports WebP.
About the widest size your theme displays them, often 1200–1600 pixels for content images. Larger only if you need zoom or high-density sharpness.
No. Lazy-load images below the fold, but not the main image at the top of the page, since delaying it hurts Largest Contentful Paint.

Sources and further reading

External links open the original source. We cite primary or official documentation for factual claims and re-check them when we update an article. See our editorial policy.

Keep reading