On this page
Want to optimize images WordPress can serve quickly? Upload files close to the size they’ll actually display, use WebP or AVIF where your host supports it, compress with a light hand, and lazy-load everything except the big image at the top of the page, which usually decides your Largest Contentful Paint.
Most slow image problems can be fixed without touching your design. If you’d rather hand the work off, our site optimization service includes it, but every step below is something you can check yourself in an afternoon.
How to optimize images for WordPress: resize first
Everyone reaches for compression first. Dimensions matter more. A 4,000-pixel photo shown in an 800-pixel column is wasted bytes, and no codec fully rescues that.
WordPress already steps in for the extreme cases. Since version 5.3, any upload wider or taller than 2560px is scaled down, and the scaled copy becomes the largest size the site uses. The original stays in your uploads folder, recorded as original_image in the metadata. That’s where the odd “-scaled” filenames come from. If you really want a different limit, the big_image_size_threshold filter changes it.
WordPress also builds smaller copies of every upload. The developer handbook’s example: a 1500×706 image produces a 500×235 Large, a 300×141 Medium and a 150×150 Thumbnail, plus a medium_large size that’s 768px wide with no height limit. Your theme may add its own on top.
Our habit is simple. Before uploading, resize to the widest the image will ever display, and skip 2560px unless the layout truly runs edge to edge on large screens.
WebP, AVIF or plain JPEG?
Use WebP as your default for WordPress. Add AVIF only if your server can make it. web.dev says both formats “will generally provide better compression than older formats” and lists both as supported in all modern browsers, but it gives no percentages.
| Format | WordPress support | The catch |
|---|---|---|
| JPEG / PNG | Always | Heavier than the newer formats |
| WebP | Since 5.8, if the host supports it | Upload errors if the server image library lacks WebP; lossless needs Imagick; animated or transparent WebP gets lossy resized copies |
| AVIF | Since 6.5, if Imagick or LibGD supports it | Check Tools > Site Health > Info > Media Handling; for older browsers, skip it or load a polyfill |
Got an error uploading a WebP file? Your host’s image library doesn’t handle WebP. That’s a hosting question, not a WordPress bug.
You’ll see a “30% smaller” figure for WebP quoted often. It comes from the WordPress 5.8 developer note, which says “around 30% smaller on average” than JPEG or PNG, and gives no method. Treat it as a rough guide. We couldn’t find an official AVIF-versus-JPEG number anywhere, so don’t trust anyone who quotes one without showing how it was measured.
Adoption is low. The HTTP Archive’s Web Almanac 2025 (data from July 2025) found LCP images were JPG on 57% of pages, PNG on 26%, WebP on 11% and AVIF on 0.7%. Most sites haven’t switched, so even a basic conversion can set you apart.
One warning from web.dev: lossy modes throw away some information, so colors may not match an equivalent JPEG. Check logos and brand-colored graphics before converting them in bulk.
Do you need a plugin to optimize images in WordPress?
Usually, yes, or something equivalent from your host. WordPress makes the resized copies on its own, but converting an existing library to WebP or AVIF is a separate job. For AVIF, the 6.5 note points to the image_editor_output_format filter, which creates AVIF versions of uploaded JPEGs while keeping the original file. A plugin built on that idea, or your host’s tooling, does the same without code.
Whatever you choose, test before committing. Pick four or five images that represent your site: a photo with gradients like sky or skin, a screenshot with small text, a logo, and a product shot. View them at full size on a real screen. Photos with gradients and graphics with sharp text tend to show damage first. If those look right, the rest will.
No one publishes a universal quality setting, because it depends on the image. Start conservative, compare, then push further only if the difference is invisible. And keep your originals. We’d run the bulk conversion on a copy of the site first, and our staging site guide shows how, so you can see the result before you convert the whole library on a live site.

Lazy loading: everything except the top
Lazy loading images in WordPress saves bytes, which is why it’s on by default. It also backfires when it hits the wrong image.
web.dev tested WordPress on the twentytwentyone theme (data from July 2020 to June 2021). Default lazy loading cut archive-page image weight from 1,173 KB to 577 KB on desktop. It also made archive-page LCP 13 to 15% slower than with lazy loading off. Skipping lazy loading for images above the fold reversed the slowdown and kept the byte savings. The authors also compared real-world data: a median WordPress LCP of 3,495 ms without lazy loading and 3,768 ms with it, though they say that’s correlation, not proof.
That study is old, and WordPress 6.3 changed things. Core never outputs both fetchpriority="high" and loading="lazy" on the same image, and the threshold for skipping lazy loading on early images moved from 1 to 3. Still, the Web Almanac 2025 found about 16 to 17% of pages lazy-load their LCP image. Themes, sliders and optimization plugins that mark every image lazy are the usual cause.
web.dev’s rule is blunt: never lazy-load your LCP image. Don’t use loading="lazy" on anything likely to be in the viewport at load. For images further down, Chrome starts loading them before they scroll into view. In July 2020 it cut its 4G distance threshold from 3000px to 1250px (3G or slower: 4000px to 2500px), and web.dev notes those values are hardcoded and may change.
To check yours, open the page, view source, and search for the hero image’s filename. If the tag has loading="lazy", fix that first. It’s the most common quick win we see on image-heavy pages.
Why the top image needs priority
web.dev calls an LCP of 2.5 seconds or less good, measured at the 75th percentile of page loads. Between 2.5 and 4.0 seconds needs improvement, and over 4.0 is poor. The element being timed can be an <img>, a video poster, a block of text, or an element with a CSS background image. On most business sites it’s the hero photo.
Image work only touches part of that clock. web.dev’s rough guideline splits LCP into time to first byte (about 40%), resource load delay (under 10%), resource load duration (about 40%) and element render delay (under 10%). It warns against turning those percentages into hard targets. The takeaway: a smaller file shrinks the load duration, but a slow server response still drags everything. If your first byte is the problem, look at caching before you re-export another photo.
For the load delay, web.dev recommends fetchpriority="high" on the likely LCP image, on no more than one or two images. WordPress 6.3 adds it automatically to the image it judges most likely to be the LCP, and the core team says this “typically improves LCP by 5-10%”. That’s their own estimate, with no method stated. The image has to be big enough: the default minimum is 50,000 pixels of width times height, so 300×200 qualifies and 200×200 doesn’t.
If the wrong image gets the attribute, or none does, your theme or page builder is usually rewriting the markup, which is why the page source is worth a look.

Width, height, srcset and sizes
Always give images width and height attributes. web.dev says that without them the browser treats images as 0×0 until they load, and the page jumps around, which hurts layout shift. WordPress normally adds them for you.
WordPress has added srcset and sizes automatically since 4.4, so phones get smaller files than desktops. The default sizes value is (max-width: {{image-width}}px) 100vw, {{image-width}}px. Themes can change it with the wp_calculate_image_sizes filter. Two limits matter: WordPress won’t alter a srcset that’s already in your content, and by default it stops listing candidates above 2048px (max_srcset_image_width).
So if PageSpeed Insights reports “Properly size images”, look at where the image sits. A narrow column with a theme that claims full width is a common mismatch. Images pasted in as custom HTML, or generated by a builder with its own srcset, won’t be fixed by core at all.
How to know it worked
Run the page through PageSpeed Insights and look at the LCP element it names. If it’s your hero image, confirm it isn’t lazy-loaded, has the right priority and is the right size. If it’s a text block, image work won’t move the number.
For perspective, the Web Almanac 2025 found 62% of phone websites had a good LCP, 25% needed improvement and 13% were poor. Wider fixes beyond images are in our Core Web Vitals guide, and the slow site checklist covers the other usual suspects.
When to get help
Bulk conversion, a theme that lazy-loads the hero, or a server without WebP or AVIF support can eat a weekend. If you’d rather not untangle it, our site optimization service handles image sizing, formats and loading behavior as part of speeding up a WordPress site, and our post on what speed optimization includes and costs sets expectations before you ask.
Frequently asked questions
Why does WordPress create a “-scaled” version of my image?
Since WordPress 5.3, uploads larger than 2560px are scaled down, and the scaled copy becomes the largest size in use. The original file stays in your uploads folder, and the big_image_size_threshold filter changes the limit.
Why do I get an error when I upload a WebP file?
Your server’s image library doesn’t support WebP. WordPress 5.8 allows WebP uploads only if the host supports them, so ask your host or check Site Health.
Should I lazy-load all my images?
No. Lazy-load images below the fold, but never the image at the top of the page, especially the likely LCP image. web.dev says this directly.
Does AVIF work on every WordPress site?
No. WordPress 6.5 supports AVIF only when Imagick or LibGD on your server does. Check Tools > Site Health > Info > Media Handling to see.
Will converting to WebP lower my image quality?
Lossy modes discard some information, and web.dev notes colors may differ from an equivalent JPEG. Test a few representative images at full size before converting everything.
Sources
- web.dev: Largest Contentful Paint (LCP) (updated September 4, 2025)
- web.dev: Optimize Largest Contentful Paint (updated March 31, 2025)
- web.dev: Choose the right image format (no date shown)
- web.dev: Browser-level image lazy loading for the web (no date shown)
- web.dev: The performance effects of too much lazy loading (no date shown; data from July 2020 to June 2021)
- Make WordPress Core: WordPress 5.8 adds WebP support (June 7, 2021)
- Make WordPress Core: WordPress 6.5 adds AVIF support (February 23, 2024; modified June 5, 2025)
- Make WordPress Core: Image performance enhancements in WordPress 6.3 (July 13, 2023)
- Make WordPress Core: Introducing handling of big images in WordPress 5.3 (October 9, 2019)
- WordPress Developer Resources: Responsive Images (November 25, 2020; modified November 21, 2022)
- HTTP Archive: Web Almanac 2025, Performance chapter (2025 edition, data from July 2025)

