WordPress images: what core does and what you must do

WordPress resizes, lazy-loads and prioritizes images for you, up to a point. What core does on its own, where it stops, and how to get the main image right.

IntermediateHow-to7 min readUpdated October 30, 2026

In this guide
  1. What core does for every image
    1. On upload
    2. When a page is printed
  2. Where core stops
  3. Step 1: find the main image
  4. Step 2: upload better files
  5. Step 3: check how images are inserted
  6. Step 4: use a plugin or a CDN carefully
  7. Mistakes to avoid
  8. Check your own page
  9. Sources

What core does for every image

These behaviors come from the WordPress core source. The first group happens when you upload a file, and the second when a page is printed.

On upload

When a page is printed

This is a good start, and for a typical blog post it is often enough. The trouble is in the pages that do not look like a typical blog post.

Where core stops

Step 1: find the main image

The largest image above the fold is usually the Largest Contentful Paint element. Run the free audit or PageSpeed Insights and open LCP request discovery and LCP breakdown. Note what the element is. Then check:

  1. Is it lazy-loaded? View the page source and find the image. If it has loading="lazy", remove it. A lazy-loaded main image waits to be discovered late. See lazy loading.
  2. Does it have `fetchpriority="high"`? If not, and it is an img element, add it. Core adds it to images that it prints or filters itself, such as ones in post content, but a plain img tag in a theme file or a builder widget may not get it.
  3. Is it the right size? Compare the file's dimensions with the size it is shown at on a phone and on a desktop screen. If the file is much larger, upload or select a smaller one.
  4. Is it a CSS background? If so, the browser finds it late and cannot use srcset. Consider an img element instead. See how to fix a slow LCP.

Step 2: upload better files

The best fix is the cheapest. Before you upload:

If you have a large library of old images, do not redo all of them. Start with the pages that get the most visits, and with the largest files in the Media Library.

Step 3: check how images are inserted

Step 4: use a plugin or a CDN carefully

Plugins and image CDNs can convert images to WebP or AVIF, resize them for each device and serve them from a network close to the visitor. They can help a lot on a large library. Before you rely on one:

The web.dev guide to image CDNs explains the idea, and our image optimization guide covers the formats and sizes.

Mistakes to avoid

Check your own page

Run the free audit and open Improve image delivery, LCP request discovery and the list of the largest files. If the main image is lazy-loaded, much larger than its slot, or loaded late, fix it first. After that, work through the largest images in order.

Sources

Start here

Free website audit

Live Google data for any public page: mobile and desktop.

Mobile + desktop · Lighthouse lab test · Real-user Chrome data when Google has it

Rather have this done for you? WordPress speed · Book a call

Related guides

All guides →