On most WordPress sites I look at, images are still the easiest speed win. Good WordPress image optimisation is less about a magic plugin and more about a few habits: the right size, the right format, sensible compression, and letting WordPress do the work it already does well.

This guide covers WebP and AVIF, what WordPress core handles for you, when to resize, plugins versus CDN image services, image SEO, and how to clean up a media library that has grown out of control.

Why WordPress Image Optimisation Still Matters Most

Images are usually the heaviest files on a page, and on many pages the largest visible element is an image. That makes them central to Largest Contentful Paint (LCP), one of Google's Core Web Vitals.

The common problems are predictable:

If your LCP is poor, my guide to improving LCP on WordPress goes further than images alone.

Concept illustration of one red image frame sending smaller copies to a phone, tablet and laptop in a teal data city
Responsive images send each device a size that fits.

WebP vs AVIF: Which Format Should You Use?

Both are modern formats that are usually much smaller than JPEG or PNG at similar visual quality.

Comparison of WebP and AVIF in WordPress, showing the version each arrived in and server requirements
Both are supported in core. Your server decides whether AVIF works.

To check whether your server can handle AVIF, go to Tools → Site Health → Info → Media Handling and look at the supported file formats. If AVIF isn't listed, ask your host, or stick with WebP.

WordPress 6.5 also lets developers convert uploads automatically. This filter, from the WordPress developer note, makes JPEG uploads produce AVIF sub-sizes:

add_filter( 'image_editor_output_format', function ( $formats ) {
    $formats['image/jpeg'] = 'image/avif';
    return $formats;
} );

WordPress keeps the original upload. Core doesn't add a <picture> fallback for older browsers, so if you need one, use a plugin or an image CDN that chooses the format per browser.

Logos and icons: for simple graphics, SVG or a small PNG is often better than either photo format. WebP and AVIF are for photographs and complex images.

What WordPress Already Does for Your Images

Before adding a plugin, it helps to know what core already handles:

Six built-in WordPress image features: sub-sizes, srcset and sizes, big image limit, lazy loading, fetch priority and dimensions
Much of the hard work is already in core.

The catch is that themes and page builders can bypass these features, for example with CSS background images or custom sliders. If your hero image is a background image, core can't prioritise it.

Resizing Before Upload vs on the Server

WordPress will create sub-sizes, but you still benefit from resizing before you upload:

A sensible habit is to resize photos to the largest size they will actually be shown at, allowing for high-density screens, before uploading. Server-side conversion is then a safety net rather than the only step.

For quality, the wp_editor_set_quality filter controls compression of generated sub-sizes. The WordPress 6.5 note says the default lossy quality is 82.

Compression Plugins vs CDN Image Services

There are two main approaches, and you rarely need both.

Whichever you choose, test the result. Check images look right, that LCP improves in real-user data, and that you haven't added layout shift. My WordPress speed optimisation checklist and the guide to fixing CLS on WordPress help with both.

Alt Text and File Names for Image SEO

Optimisation isn't only about speed. Images can bring search traffic and help people using screen readers.

Checklist of eight steps before uploading an image to WordPress, including resizing, choosing the format, compressing and writing alt text
A quick routine before each upload saves clean-up later.

Cleaning Up an Existing Media Library

If your site has years of uploads, work through it in a safe order:

  1. Take a full backup of files and database first.
  2. Find the heaviest images on your most visited pages, rather than optimising everything at once.
  3. Bulk-optimise with your chosen plugin or service, on a staging copy first if you can.
  4. Regenerate thumbnails if your theme's image sizes have changed.
  5. Remove unused uploads carefully. Tools that detect "unused" images can miss images used in custom fields, CSS or page builders, so check before deleting.
Concept illustration of a red neon sorting machine filtering a pile of teal image frames into a neat stack
Clean up gradually, starting with the pages that matter most.

Frequently Asked Questions

Should I use WebP or AVIF on WordPress?

WebP is the safe default and works on almost any server. AVIF is often smaller, and WordPress supports it since 6.5, but your server's Imagick or GD library must support it. Check Site Health to see.

Does WordPress lazy load images automatically?

Yes. Since WordPress 5.5, images with width and height get loading="lazy". Since 6.3, core also tries to avoid lazy-loading the likely LCP image and gives it high fetch priority.

Do I still need an image optimisation plugin?

Not always. Core handles sizes, srcset and lazy loading. A plugin or CDN image service helps with compression, format conversion and bulk-optimising an existing library.

What size should images be before uploading to WordPress?

Resize to the largest size the image will actually be shown at, allowing for high-density screens. WordPress scales down uploads above 2560 pixels by default, but resizing first is better.

Does alt text help image SEO?

Yes. Descriptive alt text helps search engines understand images and is essential for accessibility. Describe the image in context rather than repeating keywords.

Final Thoughts

WordPress image optimisation works best as a routine: resize before upload, choose WebP or AVIF where your server supports it, compress sensibly, keep the hero image eager, and write useful alt text. Core already does a lot, so add tools only where they fill a real gap.

If your pages are still slow, my speed and performance service looks at images alongside hosting, caching and scripts.

Right size, right format, sensible compression, and let WordPress do its part.

Official References

Sources checked on 29 October 2026: