Optimize Images WordPress - Resize, Compress, Convert and Deliver (2026)
Images are usually the heaviest part of a WordPress page and often the Largest Contentful Paint element. Getting them right is one of the most reliable ways to make pages load faster.
The Five Parts of Image Optimization
Image optimization isn't one setting. It's five jobs that work together:
| Step | What It Does | Main Tool |
|---|---|---|
| 1. Size | Serve images no larger than they're displayed | Resizing before upload; responsive images |
| 2. Compress | Reduce file size at the same dimensions | Image optimization plugin or tool |
| 3. Convert | Use WebP or AVIF instead of JPEG or PNG | Image plugin, CDN or manual export |
| 4. Lazy load | Delay images below the fold | WordPress core or a performance plugin |
| 5. Prioritize | Load the main above-the-fold image first | Fetch priority, exclusion from lazy loading |
Most sites get the biggest gains from steps 1 and 2. Steps 4 and 5 decide whether your LCP image loads early or late.
Step 1: Upload Images at a Sensible Size
A photo straight from a phone or camera can be thousands of pixels wide and several megabytes. Most content areas display images at well under 1,500 pixels wide.
WordPress creates several smaller sizes from each upload and uses responsive image markup so browsers can choose a smaller file on small screens. It also scales down very large uploads to a maximum size by default. Even so, starting with a reasonable original saves storage and processing.
| Image Use | Suggested Maximum Width |
|---|---|
| Full-width hero | Around 1,920 px for desktop, with smaller sizes for mobile |
| Content image in a blog post | Around 1,200 to 1,600 px |
| Product image | Large enough for zoom, usually 1,200 to 2,000 px |
| Thumbnails | Generated automatically by WordPress |
| Logos and icons | SVG where possible |
Step 2: Compress Images
Compression reduces file size without changing dimensions. Lossy compression removes detail the eye barely notices and gives the biggest savings; lossless compression keeps every pixel and saves less.
For photos, moderate lossy compression is usually invisible. For screenshots, logos and graphics with text, use higher quality or lossless settings to avoid blurry edges.
An image optimization plugin compresses new uploads automatically and can bulk-process your existing library. See the best image optimization plugins.
Step 3: Convert to WebP or AVIF
Modern formats are usually much smaller than JPEG and PNG at similar quality. WordPress accepts WebP and AVIF uploads in recent versions, and image plugins can convert your existing library and serve the new formats to browsers that support them. See next-gen image formats.
Step 4: Lazy Load Below-the-Fold Images
Lazy loading delays images until visitors scroll near them, so the first screen gets the bandwidth. WordPress does this natively, and WP Rocket adds lazy loading for CSS background images and video previews. See lazy loading images.
Step 5: Prioritize the Main Image
Your hero or featured image is often the LCP element. Make sure it:
- Isn't lazy loaded.
- Is discoverable in the HTML, not hidden in CSS or JavaScript where possible.
- Has high fetch priority.
- Is sized correctly for mobile.
WP Rocket's automatic Optimize Critical Images feature detects above-the-fold images and prioritizes the LCP image. See improving LCP.
Don't Forget Dimensions
Every image should have width and height attributes so the browser reserves space and nothing shifts when it loads. WP Rocket's Add missing image dimensions option fills them in. See adding image dimensions.
How WP Rocket and Image Plugins Work Together
WP Rocket doesn't compress or convert images itself. It handles delivery: lazy loading, dimensions, LCP prioritization and caching. An image optimization plugin handles compression and conversion.
| Job | WP Rocket | Image Optimization Plugin |
|---|---|---|
| Compression | No | Yes |
| WebP and AVIF conversion | No (WebP compatibility add-on helps delivery) | Yes |
| Resizing large uploads | No | Often |
| Lazy loading | Yes | Sometimes (use only one) |
| Missing dimensions | Yes | Rarely |
| LCP image prioritization | Yes, automatically | Rarely |
Imagify, from the same company as WP Rocket, is a natural pairing, but WP Rocket works with other image optimizers too.
CSS Background Images Need Special Care
Page builders and themes often use CSS background images for hero sections. Many optimization tools miss them:
- Compression plugins may not convert them to WebP or AVIF if they're referenced only in CSS.
- Native lazy loading doesn't apply to CSS backgrounds.
- The browser discovers them late, after the CSS loads, which can hurt LCP.
Where possible, use an image element for the hero instead of a background. If you keep a background, compress the file manually, consider preloading it and let WP Rocket's lazy loading for CSS background images handle backgrounds lower on the page.
Image Optimization for WooCommerce
Stores often have hundreds or thousands of product images:
- Set consistent product image sizes in WooCommerce settings.
- Bulk-optimize the library once, then let the plugin handle new uploads.
- Exclude the main product image from lazy loading.
- Lazy load gallery thumbnails and related products.
- Keep zoom images reasonable in size.
Image Optimization Checklist
- Upload images at a sensible maximum size.
- Compress new and existing images with one plugin.
- Serve WebP, and AVIF where supported.
- Lazy load images below the fold, using one tool.
- Exclude the hero image from lazy loading and prioritize it.
- Add width and height to every image.
- Use SVG for logos and icons.
- Replace image-heavy sliders with a single hero image.
- Check CSS background images, which many tools miss.
A Worked Example
An online store's product pages fail LCP on mobile. The main product image is a 3,000-pixel PNG of over 2 MB, lazy loaded by a gallery plugin.
The owner installs an image optimizer, bulk-converts the library to WebP with lossy compression, and caps new uploads at 2,000 pixels. The product image drops to a small fraction of its original size. Excluding the first gallery image from lazy loading lets it load immediately, and mobile LCP moves into the good range.
Optimize Images WordPress FAQ
What is the best way to optimize images in WordPress?
Upload at a sensible size, compress and convert with an image optimization plugin, lazy load below-the-fold images and prioritize your main image.
Does WordPress optimize images automatically?
It creates resized versions and scales down very large uploads, but it doesn't compress them as much as a dedicated tool or convert existing images to modern formats.
Does WP Rocket compress images?
No. It handles lazy loading, dimensions and LCP prioritization; pair it with an image optimizer like Imagify for compression and conversion.
Should I use lossy or lossless compression?
Lossy for photos, where savings are larger and differences are rarely visible. Lossless or higher quality for graphics with text.