Optimise images in WordPress: formats, sizes, lazy loading and CDNs

Jellybean, the OG Nexus mascot: Optimise images in WordPress: formats, sizes, lazy loading and CDNs

To optimise images in WordPress, start with the ones every visitor loads. On og-nexus.com that was the header logo. In November 2026 we gave it 320 and 640 pixel WebP copies with srcset, so a phone no longer downloads the desktop file. Images often make up most of a page's weight, and getting them right is one of the quickest ways to a faster site and better Core Web Vitals.

Three things our own site taught us

The logo counts. It is on every page, so it is the first image worth resizing.

Reserve the space. The 17 screenshots in our plugin guides are 1117 pixels wide. Each one reserves its place in the layout before it loads, so the text below does not jump.

Empty alt text is read as missing. A Bing site scan on 30 November 2026 flagged our images with alt="". Our product thumbnails now use the product name.

1. Pick the right format

WebP: much smaller than JPEG and PNG at the same quality, and supported by every modern browser. A safe default.

AVIF: smaller still, especially for photos, though slower to create.

SVG: for logos and icons, so they stay sharp at any size.

Keep PNG only where you need lossless detail, such as screenshots with fine text.

2. Upload at a sensible size

A 6000-pixel photo straight from a camera is many times bigger than any screen needs. Resize before upload, or let WordPress cap the size: around 2000 to 2560 pixels on the long edge is plenty for full-width images. WordPress then creates smaller copies and uses srcset so each device downloads the size it needs.

3. Compress

A quality setting of around 75 to 85 is usually indistinguishable from the original and far smaller. Compress on upload so you never forget, and bulk-optimise the images you already have.

4. Lazy-load, but not everything

WordPress lazy-loads images below the fold by default. Keep it that way.

The main image at the top of the page (often the LCP element) should load straight away, ideally with fetchpriority="high". Lazy-loading it makes the page feel slower.

Always set width and height on images so the layout does not jump while they load.

5. Serve images through a CDN

A content delivery network keeps copies of your images on servers around the world, so visitors download them from somewhere close. Many CDNs can also convert to WebP or AVIF and resize on the fly. Make sure the CDN respects your cache headers and that image URLs are rewritten correctly.

6. Retina screens

High-density screens show twice the pixels. Serve 2x versions only where sharpness really matters, such as product photos and logos, and let srcset pick them for the screens that benefit.

7. Names and alt text

Descriptive file names and good alt text help search engines and visitors who use screen readers. OG Media File Renamer renames files and fills in titles and alt text with AI Vision suggestions.

8. Clear out the clutter

Unused uploads and orphaned thumbnails take up disk space and slow backups. OG Media Cleaner finds media nothing uses and lets you trash it safely; see clean up your media library.

OG tools for images

OG Picture Core and OG Perfect Images handle formats, sizes and retina copies inside WordPress. Read the OG Picture Core guide, our OG Perfect Images review, or browse the OG plugin family.

Further reading: web.dev: Learn Images