WordPress image sizes and srcset: what WordPress does for you
You upload one big photo to a WordPress post. It then turns up in a small card, a sidebar and a full-width hero, and somehow the phone still downloads a monster. Annoying, and usually avoidable.
WordPress image sizes and srcset help the browser pick a suitable file for the space available, but only when the theme and content are set up sensibly. You don’t need to create every crop by hand. What helps is knowing what WordPress generates, how the browser chooses a source and where your theme may be overriding the defaults.
What WordPress does when you upload an image
WordPress keeps the original upload and can create several derivative sizes, like thumbnail, medium and large. Themes and plugins can register more. The real dimensions depend on the site’s settings and code. After changing sizes you may need to regenerate thumbnails for older images, but I wouldn’t run a bulk process without a backup and enough storage.
Size names don’t guarantee display dimensions. A theme can request a custom crop or scale an image with CSS. Check the generated files and the rendered page instead of assuming “large” means the same thing on every site.
What srcset and sizes mean
The srcset attribute hands the browser a list of image sources at different widths. The sizes attribute says how much space the image will take in the layout. The browser combines that with the device pixel density and viewport to choose.
So a phone can download a smaller file than a desktop, if the markup and available derivatives allow it. If the sizes value is wrong, the browser may pick a needlessly large image, or one too small for the display. Responsive images are a collaboration between WordPress, the theme and the browser.
Inspect the rendered HTML or the Network panel in developer tools. Look for srcset and sizes on the image, then check which file actually downloaded. Test more than one viewport, because a desktop preview doesn’t tell you what a phone received.
Check how the theme requests images
Themes use featured images, custom crops and responsive sizes in different places. A blog card may ask for a square crop while the article uses a wide image. Some themes use CSS background images, which don’t get srcset markup like an img element.
Review representative templates: homepage, category archive, article and any product layout. Check that important images are sharp, the crop makes sense and the chosen file isn’t far bigger than the space it fills. An image that looks fine on a high-density monitor can look soft elsewhere if the wrong derivative is served.
If the theme uses a custom size, check it’s registered and generated correctly. A missing size may fall back to the original upload, which hurts most when that original is several thousand pixels wide.
Upload at a sensible source size
Responsive handling doesn’t make every upload harmless. Start with a source large enough for its biggest intended display, and don’t upload an enormous file the design never uses. Compress photos, choose a sensible format and keep the original somewhere safe in case you need to recrop.
Don’t shrink a file until product details or instructional images turn unclear. Optimisation balances file weight against useful information. Decorative images can go small, and diagrams and product close-ups need clarity.
Lazy loading and the first image
WordPress may add loading behaviour to images, and themes can change it. Lazy loading reduces work for images further down the page, but the main image visible on arrival shouldn’t be delayed. If the largest contentful element is a hero image, make sure the browser finds it early, and ask whether the page is fetching a full-size asset when a smaller one would do.
Check the actual markup and test the experience. I wouldn’t add a plugin just because an article says every image should be lazy-loaded. Browsers and recent WordPress versions already handle parts of it.
A quick responsive image audit
- Open one important page on a desktop and a phone-sized viewport.
- Inspect the image element’s srcset and sizes values.
- Check the selected network file and its dimensions.
- Compare the displayed crop and sharpness.
- Inspect whether above-the-fold images are delayed.
- Review custom theme sizes and regenerate thumbnails only when needed.
If the browser downloads the original for every display, investigate the theme or plugin creating the markup. If it selects a good derivative, focus on compression, layout or other page resources instead.
FAQ
Does WordPress always create srcset?
WordPress can generate responsive image markup, but theme and plugin output can affect what appears. Inspect the rendered page.
Should I upload the largest possible image?
Upload enough resolution for the largest intended use, then let the site serve suitable derivatives. Huge source files add handling and storage costs.
Can a plugin fix every responsive image problem?
Not necessarily. The theme may request the wrong size or omit responsive markup. Find the cause before adding another layer.
Related reading
- Image SEO on WordPress: file names, alt text and size
- Image formats: WebP, AVIF and when JPEG is fine
Inspect one image on a mobile viewport and note which file the browser downloads. Is WordPress serving the right size, or just displaying a large file smaller?