In this article
In short
To optimise images in WordPress, upload sensibly sized originals, serve WebP or AVIF, let WordPress generate responsive sizes with srcset, always keep width and height so the layout does not jump, lazy load images below the fold but never the main hero image, compress automatically and deliver through a CDN. Add alt text that describes what matters.
On most business websites, images make up the largest share of what a visitor downloads. A single photo straight from a phone or a stock library can weigh more than all the site’s code put together, and that weight lands hardest on mobile visitors.
WordPress already does a lot of the work for you. The trick is knowing which parts are automatic, which need a plugin or a CDN, and which come down to the people uploading images.
Which image format should you use in WordPress?
For photos and most graphics, the modern formats WebP and AVIF are the right choice. According to MDN’s guide to image formats, lossy WebP files are typically 25-35% smaller than comparable JPEGs, and AVIF usually compresses better still. All current major browsers support WebP, and AVIF is supported in current versions of Chrome, Edge, Firefox and Safari.
| Format | Best for | Notes |
|---|---|---|
| JPEG | Photos, as a fallback | Universal, but larger files |
| PNG | Screenshots, images needing sharp edges | Large for photos |
| WebP | Photos and graphics | Small, very widely supported, supports transparency |
| AVIF | Photos and graphics | Usually smallest, slightly less support, no progressive display |
| SVG | Logos, icons, simple illustrations | Vector, scales perfectly; only upload SVGs from sources you trust |
WordPress accepts WebP uploads, and since WordPress 6.5 it accepts AVIF too, as long as the server’s image library supports it. You can check this under Tools, Site Health, Info, Media Handling.
Tip: You do not need to convert every image by hand. Most optimisation plugins and many CDNs keep your original JPEG and serve WebP or AVIF automatically to browsers that accept it.
What image sizes does WordPress create?
When you upload an image, WordPress generates several smaller copies (thumbnail, medium, large and others defined by your theme). It then adds srcset and sizes attributes to the image markup, so each browser picks the smallest file that still looks sharp on that screen. The WordPress responsive images documentation notes that this happens automatically, with no settings to configure.

What WordPress cannot fix is a huge original. If someone uploads a 6,000 pixel photo for a blog column that is 800 pixels wide, the site stores and processes far more than it needs. Agree a simple rule with your team:
- Full-width hero images: around 2,000-2,560 pixels wide.
- Images inside content: around 1,200-1,600 pixels wide.
- Team photos, logos and icons: no bigger than they appear, doubled for sharp screens.
A well-built theme also registers image sizes that match its actual layout, so the copies WordPress generates are ones the design really uses.
Why do width and height matter?
If the browser does not know how big an image will be, it leaves no space for it. When the image arrives, everything below jumps down. That jump is measured as Cumulative Layout Shift (CLS), one of Google’s Core Web Vitals, and it is the reason people tap the wrong button on a loading page.
The fix is simple: always include width and height attributes, or reserve space with the CSS aspect-ratio property. web.dev suggests aiming for a CLS of 0.1 or less. WordPress adds dimensions to images inserted through the editor, but custom theme code, sliders and page builders do not always, so it is worth checking.
How should lazy loading work, and what should not be lazy loaded?
Lazy loading means images further down the page only download when the visitor scrolls near them. Browsers support this natively with loading="lazy", and WordPress adds it to images automatically.
The catch is the image at the top of the page. web.dev’s guidance on lazy loading is clear: do not lazy load images that are likely to be visible when the page first loads, especially the one that is your Largest Contentful Paint (LCP), usually the hero image. Lazy loading it makes the browser wait before fetching it, so the page feels slower.
Recent WordPress versions try to skip lazy loading for the first images and mark the likely LCP image as high priority. That detection is not perfect, particularly with sliders, page builders and background images set in CSS.
Watch out: Many optimisation plugins add their own JavaScript lazy loading on top of WordPress’s. Two systems fighting over the same images can delay the hero image or cause blank spaces. Use one approach, and exclude the hero.
Do you need a compression plugin?
WordPress resizes images, but it compresses them only lightly and does not convert your existing library to modern formats. A compression plugin, or compression built into your host or CDN, fills that gap. Look for:
- Automatic compression on upload, with a choice of quality level.
- WebP and/or AVIF conversion with a fallback for older browsers.
- Bulk optimisation of images already in the media library.
- Keeping the original file, so you can re-optimise later.
Lossy compression at a sensible quality setting is invisible to most visitors and removes a large share of the file size. Check a few images by eye after changing settings, particularly photos of products, where colour and detail matter.
Does a CDN help with images?
Yes. A content delivery network (CDN) stores copies of your images on servers around the world, so a visitor in London and one in New York both download from somewhere nearby. Some CDNs can also resize and convert images on the fly, which can replace part of what a plugin does.
If your site already sits behind Cloudflare, caching images at the edge is usually a quick win. On our managed hosting, sites run with Cloudflare in front for this reason. Whatever setup you use, make sure the plugin and the CDN are not both converting images, or you will spend time chasing odd results.
What makes good alt text?
Alt text is read aloud by screen readers and shown when an image fails to load. It also helps search engines understand the image. The W3C’s images tutorial explains that informative images need a short description of what matters, while purely decorative images should have empty alt text so screen readers skip them.
Good alt text is specific and short: “Blue linen shirt, front view, on a hanger” is useful, “image of shirt” is not. Do not stuff keywords into it. If the image contains text, such as an offer banner, the alt text should say the same words.
If you would like this set up properly once and kept that way, it is the kind of thing we handle in WordPress maintenance, or you can look at our care plans.
The short version
- Serve WebP or AVIF, with a JPEG fallback, through a plugin or CDN.
- Upload sensibly sized originals and let WordPress create responsive sizes.
- Keep width and height on every image to avoid layout shift.
- Lazy load images below the fold, never the hero or LCP image.
- Write alt text that describes what matters, and leave decorative images empty.
Questions people ask
Should I use WebP or AVIF on my WordPress site?
Both are far smaller than JPEG and PNG. AVIF usually compresses better, while WebP is supported by more browsers and decodes progressively. A common approach is to serve AVIF where the browser accepts it and WebP or JPEG as a fallback, which most optimisation plugins and CDNs can do for you.
What size should images be before uploading to WordPress?
Upload images no larger than the widest place they will be shown, allowing for high-density screens. For a full-width hero that is often around 2,000-2,560 pixels wide; for an image in a blog column, much less. WordPress then generates smaller versions automatically.
Does lazy loading hurt SEO?
Native lazy loading does not stop Google from seeing images. The risk is performance: lazy loading the large image at the top of the page delays your Largest Contentful Paint, which is one of Google's Core Web Vitals. Lazy load images further down the page only.
Do I need an image optimisation plugin?
Usually yes, unless your host or CDN already converts and compresses images. WordPress resizes images and adds responsive markup on its own, but it does not compress aggressively or convert existing JPEGs to modern formats in bulk.