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
- Crop and resize to the display width.
- Convert to WebP or JPEG at quality 75–85.
- Check the file size (aim for the smallest that looks right).
- Rename the file descriptively.
- 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 ImageFrequently asked questions
Sources and further reading
- WordPress Make: WordPress 5.8 adds WebP support
- Google Search Central: Image SEO best practices
- web.dev: Optimize Largest Contentful Paint
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
- Image Compression Explained: Formats, Quality Settings and ToolsHow image compression works, which format to use, what quality setting to pick and how to shrink photos without visible loss. A practical 2026 guide.
- Image Optimization for Core Web Vitals: Fix LCP and CLSHow images affect LCP and CLS, with fixes: right size and format, fetchpriority, no lazy-loading the hero, and set dimensions on every image.
- Responsive Images in HTML: srcset, sizes and the picture ElementLearn how srcset, sizes and the picture element let browsers load the right image for each screen, with copy-paste examples and common mistakes.
- JPEG vs PNG vs WebP vs AVIF: Which Image Format Should You Use?Compare JPEG, PNG, WebP and AVIF on file size, quality, transparency and browser support, with a simple rule for choosing the right image format.