A WordPress editor compares a large original image with a smaller web-ready version before publishing

Editorial illustration.

A WordPress post can look crisp in the block editor and still feel sluggish on a phone. Most of the time, the culprit isn’t an underpowered VPS or a misbehaving theme—it is a 6,000-pixel camera original dropped straight into a 760-pixel article column.

Out of the box, WordPress helps by generating intermediate thumbnails and adding responsive srcset and sizes attributes. That safety net is great, until an editor picks “Full Size” out of habit, a theme requests an oversized featured image, or someone uploads a 4 MB PNG screenshot that should have been a 90 KB WebP.

Why a 6,000-pixel photo drags down a 760-pixel column

Every byte of an image has to be fetched and decoded by the browser. On fibre at the office, a 3 MB hero banner barely registers; on a congested 4G connection while commuting, it stalls Largest Contentful Paint (LCP) and competes directly with your stylesheets and fonts.

Shrinking a 4,000-pixel file with CSS (width: 100%; height: auto;) does not save a single kilobyte over the wire. The browser still downloads the full payload and burns extra CPU decoding pixels the layout never displays. Match your source dimensions to the actual slot—for a 760px content column, exporting at 1,520px wide (2x for Retina displays) is plenty. Keep the raw 6,000px camera master in your local archive or DAM, not in wp-content/uploads/.

What WordPress srcset and sizes actually do

When you insert an image through the Media Library, WordPress outputs srcset candidates (medium, large, medium_large, plus any custom sizes registered by your theme) so the browser can pick the smallest file that still looks sharp for the current viewport.

If your theme registers custom aspect ratios, declare them cleanly in functions.php rather than letting editors upload awkward crops:

add_action('after_setup_theme', function () {
    add_image_size('article-card', 800, 450, true);
    add_image_size('article-hero', 1440, 810, true);
});

Two caveats catch people out. First, srcset only works as well as the sizes attribute—if a multi-column card grid tells the browser 100vw, mobile and desktop devices alike may pull a bigger candidate than needed. Second, changing Media Settings or adding add_image_size() does not retroactively resize old uploads. If you add a new size later, regenerate only what is missing via WP-CLI:

wp media regenerate --only-missing

Sizing, formats, and cleaning an existing library

Choose formats based on what the image actually depicts:

  • Photographs: WebP or AVIF give much smaller files than JPEG at the same visual quality.
  • Screenshots, UI mockups, and diagrams with sharp text: Lossy compression creates ugly halos around letters; test WebP lossless or stick to an optimised PNG.

If you are inheriting a bloated wp-content/uploads folder, don’t run a blind bulk-overwrite script across five years of posts. Start by auditing the biggest files on your highest-traffic landing pages. Keep backups of originals before replacing anything, verify that crops and focal points still line up, and check whether old URLs are hardcoded in email templates or social OG tags.

Optimisation plugins, lazy loading, and Cloudflare

An image optimisation plugin earns its keep when multiple non-technical editors upload directly from phones or cameras and you need automatic resizing plus WebP/AVIF conversion. Before installing one, check whether it keeps a reversible backup, whether compression runs locally or via a paid external API, and whether you can exclude logos or crisp UI screenshots. Most importantly: run one image optimiser, not three plugins fighting over .htaccess rewrite rules and CDN URLs.

Be careful with lazy loading too. WordPress adds loading="lazy" to many images automatically, which is great below the fold—but lazy-loading your main above-the-fold hero image delays LCP. Make sure your hero image loads eagerly with fetchpriority="high" and explicit width/height attributes to prevent layout shifts (CLS). And remember that putting Cloudflare in front of your site caches images closer to visitors, but unless you enable Cloudflare Image Resizing / Polish, a CDN still serves whatever oversized file your origin hands it.

Checking what the browser actually downloads

Open your published article in Chrome or Firefox, open DevTools → Network, filter by Img, and reload with cache disabled. Look at the Size column and hover over the <img> in Elements to compare its intrinsic size against its rendered size. If a 400px card thumbnail is downloading a 2,400px file, either your theme’s sizes attribute is off or the block is still pointing to full.

Fix one high-traffic page template today, measure before and after in DevTools, and make resizing before upload part of your publishing habit.

For related WordPress maintenance guides, check out:

Sources