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:

The image optimization workflow
StepWhat It DoesMain Tool
1. SizeServe images no larger than they're displayedResizing before upload; responsive images
2. CompressReduce file size at the same dimensionsImage optimization plugin or tool
3. ConvertUse WebP or AVIF instead of JPEG or PNGImage plugin, CDN or manual export
4. Lazy loadDelay images below the foldWordPress core or a performance plugin
5. PrioritizeLoad the main above-the-fold image firstFetch 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

Illustration for Step 1: Upload Images at a Sensible Size on the Optimize Images WordPress page, showing a image diagram

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.

Practical maximum widths
Image UseSuggested Maximum Width
Full-width heroAround 1,920 px for desktop, with smaller sizes for mobile
Content image in a blog postAround 1,200 to 1,600 px
Product imageLarge enough for zoom, usually 1,200 to 2,000 px
ThumbnailsGenerated automatically by WordPress
Logos and iconsSVG 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

Illustration for Step 4: Lazy Load Below-the-Fold Images on the Optimize Images WordPress page, showing a image diagram

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:

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

Illustration for How WP Rocket and Image Plugins Work Together on the Optimize Images WordPress page, showing a image diagram

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.

Who does what
JobWP RocketImage Optimization Plugin
CompressionNoYes
WebP and AVIF conversionNo (WebP compatibility add-on helps delivery)Yes
Resizing large uploadsNoOften
Lazy loadingYesSometimes (use only one)
Missing dimensionsYesRarely
LCP image prioritizationYes, automaticallyRarely

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:

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:

See speeding up WooCommerce.

Image Optimization Checklist

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.