Image Optimization for WordPress
Resize the image to the size it is displayed at, save it as WebP (or AVIF), compress it lightly, and let every image below the fold lazy load. Most WordPress sites get all of that by letting a plugin do it automatically on upload.
Images are often the heaviest part of a page, and oversized images are one of the most common causes of a slow WordPress site. You can see how much the images weigh on your site in PageSpeed Insights (pagespeed.web.dev), which points to the individual images.
Why Images Make the Site Slow
A picture straight from a camera or phone typically takes several megabytes. Upload it unprocessed and four things happen:
- Large files: the browser has to fetch everything, which hits mobile the hardest.
- Wrong dimensions: a 4000 px wide image shown at 400 px wastes bandwidth.
- Old formats: JPEG and PNG still work, but they are no longer the most efficient.
- No lazy loading: images far down the page are fetched even if nobody scrolls there.
The Four Steps
1. Resize to the Right Dimensions
Never upload an image much larger than what is displayed. WordPress scales images down itself if they are larger than 2560 px on the longest side, and stores the original separately (source: make.wordpress.org, read 22/11/2026), but you save space and time by doing it before upload.
| Use | Width that is typically plenty |
|---|---|
| Full-width hero | 1920 px |
| Blog post images | 1200 px |
| Thumbnails | 400 to 600 px |
| Product images | 800 to 1200 px |
For retina screens an image can be up to twice as wide as its display size. More than that is waste.
2. Compress
- Lossy: removes data you can't see. Gives the smallest files and suits photos.
- Lossless: keeps everything and saves less. Suits graphics and screenshots.
For photos on a website, lossy at a quality around 80 to 85 percent is usually a good starting point. Look at the result before saving, because the right number depends on the image.
3. Choose a Format
| Format | Best for | Support |
|---|---|---|
| WebP | Photos and graphics | 97.2% of browser users |
| AVIF | Photos where you want the smallest files | 96.7% of browser users |
| JPEG | Fallback | All |
| PNG | When you need transparency and lossless graphics | All |
| SVG | Logos and icons | All |
Source for support: caniuse.com (global usage), read 22/11/2026.
The illustration at the top shows a worked example: a camera photo of 4000 x 3000 px, scaled to 1200 px and saved as WebP, ends up as a small fraction of the original. The percentage depends on the subject, so measure your own image.
Google states that lossy WebP is 25 to 34 percent smaller than JPEG at the same quality (source: developers.google.com/speed/webp, read 22/11/2026). AVIF can give smaller files than WebP, but needs support on the server when you upload.
WordPress can handle AVIF from version 6.5, if the server's image library supports it (source: make.wordpress.org, read 22/11/2026). Check under Tools, Site Health, whether your server can. If in doubt, use WebP, which works almost everywhere.
4. Lazy Loading
Lazy loading means an image is only fetched when it is about to enter the screen. WordPress has added loading="lazy" to images automatically since version 5.5.
The exception is the large image at the top of the page, typically the LCP element. It must not be lazy loaded, because then the fetch starts too late. Google's web.dev recommends the same (web.dev, read 22/11/2026). Modern themes and most optimization plugins handle this, but check it if your LCP time is poor.
Plugins for Automatic Optimization
Prices and quotas change often, so always look at the publisher's own pricing page before you choose. Versions and install counts are from wordpress.org, read 22/11/2026.
ShortPixel Image Optimizer
Version 6.6.2, over 300,000 active installations. Compresses on upload, can convert to WebP and AVIF, and can optimize existing images. A free monthly quota, then credits or a subscription (shortpixel.com/pricing). It is the plugin I choose most often, because it keeps the originals as a backup.
Imagify
Version 2.3.5, over 900,000 active installations. Made by the people behind WP Rocket. A free plan of 20 MB a month, which the publisher describes as roughly 200 images, and paid plans with unlimited volume (imagify.io/pricing). It pairs well with WP Rocket, see my post on caching plugins.
Smush
Version 4.3.7, over 1 million active installations. Compression, lazy loading and bulk optimization in the free version, more features (including CDN) in Pro. Pro follows the WPMU DEV membership, with plans from 50 dollars a year for one site (wpmudev.com, read 22/11/2026).
EWWW Image Optimizer
Version 8.9.2. Can optimize locally on your own server without sending images to an external service, which is an advantage if you don't want images leaving the house. The Easy IO service (CDN and automatic WebP/AVIF) costs from 80 dollars a year (ewww.io/plans, read 22/11/2026).
| Plugin | Optimizes | Best for |
|---|---|---|
| ShortPixel | Via external service | Small files, backup of originals |
| Imagify | Via external service | WP Rocket users |
| Smush | Via external service | Beginners |
| EWWW | Locally or via service | Those who want images kept on their own server |
Use only one optimization plugin at a time. Two that convert and serve WebP can get in each other's way.
Manual Optimization
If you want to process the images before uploading:
| Tool | Platform |
|---|---|
| Squoosh (squoosh.app) | Browser |
| TinyPNG (tinypng.com) | Browser |
| ImageOptim | Mac |
| GIMP | All |
Workflow: resize, export as WebP at about 80 percent, upload. Squoosh shows the difference before and after side by side, so you can find the lowest quality that still looks right.
WordPress Settings
Image Sizes
Under Settings, Media, you decide the sizes WordPress makes of each image. The defaults are 150 px for thumbnail, 300 px for medium and 1024 px for large. If your theme fits other widths, change them, so WordPress doesn't make sizes you never use. After a change, existing images must be regenerated, for example with WP-CLI (wp media regenerate) or a plugin.
Avoid "Full Size"
Don't insert images at full size in the text. Choose the size that fits the space, and WordPress also sends a srcset, which lets the browser fetch a suitable version.
CDN for Images
A CDN delivers files from servers close to visitors. It helps most if you have visitors far from your server. Bunny CDN costs from 0.01 dollars per GB in Europe and North America (bunny.net, read 22/11/2026). If you only have Danish visitors and hosting in Denmark or northern Europe, the gain is often small.
Checklist
Before upload
- Resized to a suitable width
- Compressed
- Saved as WebP, if you don't use a plugin
In WordPress
- Optimization plugin installed and automatic compression on
- WebP or AVIF on
- Lazy loading on, but not on the topmost image
- Existing images bulk optimized
Ongoing
- Check PageSpeed Insights for image warnings
- Delete images you don't use
Frequently Asked Questions
Does compression destroy images?
Not noticeably at moderate compression. Always keep the originals so you can redo it.
Should I optimize images already in the media library?
Yes. Most plugins can bulk optimize them. Take a backup of uploads first.
What about retina screens?
Make the image up to twice as wide as the display size. WebP keeps the file reasonable.
WebP or AVIF?
WebP is the safe choice. AVIF can give smaller files, but requires your server to handle the format. Most plugins can serve AVIF to those who support it and WebP to the rest.
How do I see whether the images are optimized?
Run the site through PageSpeed Insights. It points to the individual images that are too large or in an old format.
Conclusion
- Install one optimization plugin
- Turn on automatic compression and WebP
- Bulk optimize existing images
- Upload at a suitable size from now on
Images are only one part of speed. The rest is in my WordPress speed guide.
