To compress images in WordPress, resize each image to the largest size it will actually display, then reduce its file size with an online tool or an image-optimization plugin. For an existing site, a plugin is usually the practical choice because it can process the Media Library and optimize future uploads automatically.
The order matters: resize first, compress second, then check the finished page. Compression alone will not fix a 4000-pixel photo displayed in a 900-pixel content column.

Table of Contents
The short version
- Find the largest size at which the image appears on your site.
- Resize the original close to that width before uploading it.
- Use JPEG, WebP or AVIF for photographs. Keep PNG for graphics that need transparency or crisp lossless detail.
- Compress the image and compare it with the original at the size visitors will see.
- Use a WordPress plugin if you want automatic optimization or need to process existing uploads.
- Test the page on mobile after clearing any page cache or CDN cache.
Resize images before you compress them
Image dimensions and file size are separate problems. A photo can be heavily compressed and still be larger than the page needs.
Start with the image’s largest rendered width. If a hero image fills a 1400-pixel layout, uploading a 4000-pixel original usually adds storage and processing work without improving the result. A 700-pixel blog image does not need the same dimensions as that hero.
WordPress generates several image sizes and adds responsive image information when your theme uses the standard image functions. That helps the browser choose an appropriate file, but it is not a reason to keep every camera original in the Media Library. Upload a sensibly sized source and let WordPress handle the smaller variants.
QreativeThemes products show recommended dimensions on placeholder images. If you use another theme, inspect the image container in your page builder or ask the theme author for the intended size. You can also resize a copy in your usual photo editor before uploading it.
Method 1: Compress images before uploading
This method suits a small site with occasional uploads. It does not add another WordPress plugin, and you can inspect every result before it reaches the site.
Squoosh gives you a side-by-side preview and controls for dimensions, format and quality. TinyPNG is quicker when you want the service to choose the compression settings.
A reliable manual workflow
- Make a copy of the original image.
- Resize the copy to the largest width needed by the design.
- Export a photograph as WebP or JPEG. Use PNG only when the image needs transparency or lossless detail.
- Lower the quality until the first visible artifacts appear, then move the setting back slightly.
- Upload the compressed file to WordPress and add useful alt text that describes the image when the image is informative.
- Open the published page on a phone and check sharpness, loading and cropping.
Do not chase one file-size target for every image. A small logo, a full-width photograph and a detailed product image have different jobs. The useful comparison is visual quality against transferred bytes for that particular placement.
Method 2: Use a WordPress image compression plugin
A plugin is the better fit when several people upload images, the site has a large Media Library, or you want new uploads handled automatically. Most established image-optimization plugins can compress files, resize oversized uploads, create WebP or AVIF versions and run a bulk process for older images.
Three established options are ShortPixel Image Optimizer, Imagify and Smush. Their free limits, paid plans and available settings change, so compare the current plugin pages rather than choosing from an old feature table.
Install one plugin, not several. Your host or CDN may already optimize and convert images, so check that first. Two tools rewriting the same image URLs or generating the same modern formats can make troubleshooting harder.
Set up a plugin without risking the whole library
- Take a site backup and keep the plugin’s original-image backup option enabled while testing.
- Open Plugins → Add New Plugin, search for the plugin by name, then install and activate it.
- Enable automatic optimization for new uploads.
- Choose a moderate or recommended compression level rather than the most aggressive setting.
- Generate WebP or AVIF only if your host, CDN or another plugin is not already doing it.
- Optimize a few representative images: a hero photograph, a content image, a logo and an image containing text.
- Check those pages on desktop and mobile before starting the bulk optimizer.
Bulk optimization can use credits and create several files for every Media Library item because WordPress stores multiple image sizes. Review the plugin’s estimate before processing a large library.
Choose the right image format
File format is part of the decision, but it does not replace resizing and compression.
- JPEG: a dependable choice for photographs when you need a simple original or fallback.
- WebP: useful for photographs and graphics, with good browser support and usually smaller files than comparable JPEG or PNG images.
- AVIF: can produce smaller files, although encoding, plugin support and the best quality setting vary by setup.
- PNG: keep it for transparency, screenshots or graphics where lossless detail matters. Photographic PNG files are often unnecessarily heavy.
- SVG: suitable for trusted vector artwork such as logos and icons. WordPress does not allow unrestricted SVG uploads by default because SVG files can contain code.
WordPress supports WebP, and current WordPress versions can also accept AVIF when the server supports it. You can check the formats available on your installation under Tools → Site Health → Info → Media Handling. Upload support alone does not guarantee that every visitor receives the best format; that depends on the files inserted by your theme, plugin, host or CDN.
How to check whether compression worked
Open the same public page before and after the change in PageSpeed Insights. Test the page URL, not the image URL. Look for image-related recommendations and check whether the largest visible image is the Largest Contentful Paint element.
Use a private browser window after clearing your WordPress and CDN caches. Confirm that:
- the image is still sharp at its displayed size;
- text, gradients and fine edges do not show obvious artifacts;
- the mobile crop still shows the important part of the image;
- the page serves the optimized file rather than the old cached version.
Image work is only one part of performance. If the page remains slow, work through the other causes in our guide to speeding up a WordPress site.
Common image compression mistakes
- Compressing without resizing: the file still contains pixels the layout never displays.
- Using PNG for every image: photographs usually need a photographic format.
- Running several optimization systems: check your host, CDN and current plugins before adding another layer.
- Bulk-processing before testing: optimize a small set and keep restorable originals until you trust the settings.
- Lazy-loading the main hero image: the first large image may be the LCP element and often needs to load promptly. Let your theme or performance tool exclude it when necessary.
Frequently asked questions
Can WordPress compress images automatically?
WordPress creates additional image sizes and applies its own processing, but a dedicated optimization plugin gives you more control over compression, maximum dimensions, modern formats and existing Media Library files.
Should I compress images before or after uploading?
Compress before uploading if you manage a small number of images and want to inspect each one. Use a plugin when you need consistent automatic handling or want to optimize an existing library. You can still resize unusually large source images before uploading them.
Does image compression reduce quality?
Lossy compression removes data and can create artifacts. Moderate settings are often hard to notice on website photographs, but images containing text, gradients or sharp edges need a visual check. Lossless compression preserves image data but usually saves less space.
What is the best WordPress image compression plugin?
There is no best option for every site. Compare output quality, original-image backups, bulk processing, modern-format delivery, monthly limits and compatibility with your host or CDN. Test the winner on a few different image types before committing the full library.
For a small site, start by resizing and compressing the next image manually. For a site with an established Media Library, back it up, choose one optimization system and test a small batch before running the bulk tool.
About Barry de Jong
I'm the founder and developer of QreativeThemes. I've spent over 15 years building WordPress themes for small businesses, with more than 11,000 websites built using my themes, many ranking at the top of local search results in their area. I build practical solutions that business owners can manage themselves.


