How to Fix Blurry Images in WordPress
A blurry image in WordPress is usually a file narrower than the space it fills: the wrong Resolution in the block, a sizes attribute capped at the chosen size, a srcset with no larger file, or a second round of compression.
A blurry WordPress image is nearly always a file narrower than the space it fills — find out which file the browser actually loaded before you touch quality settings. WordPress never enlarges images, so every fix below comes down to making a wide enough file exist and making the browser pick it.
Check which file the browser chose
The src in the HTML is not necessarily the file on screen: with srcset the browser picks a candidate itself. Select the image in DevTools → Elements, then run this in the Console ($0 is the selected node):
[$0.currentSrc, $0.naturalWidth, $0.clientWidth, devicePixelRatio]
currentSrc is the file actually downloaded and naturalWidth its pixel width. For a sharp result, naturalWidth should be at least clientWidth × devicePixelRatio. Then read the srcset and sizes attributes of the same <img>.
This is the result on a WordPress 7.1.5 test install with Twenty Twenty-Five: a 3000 px photo in an Image block set to Full width with Resolution Large, viewed in a 1440 px window:
currentSrc /wp-content/uploads/2026/11/mountain-lake-1024x683.jpg
naturalWidth 1024
clientWidth 1425
sizes (max-width: 1024px) 100vw, 1024px
srcset 6 candidates, including 1536 and 2048 px files
The larger files were in srcset, but sizes told the browser the image is never wider than 1024 px, so it picked the 1024 px file and stretched it to 1425 px.
| Symptom | What the check shows | Cause | Fix |
|---|---|---|---|
| Full-width or wide image soft on large screens | currentSrc is a -1024x… file; sizes reads (max-width: 1024px) 100vw, 1024px |
Block Resolution is Large, and sizes was built from that width |
Set Resolution to Full Size |
| Soft only on retina screens and phones | naturalWidth equals clientWidth; srcset missing or has no larger width |
No larger file with the same aspect ratio exists | Upload a larger original or register a 2× size |
| Thumbnail-looking image in a theme slot | currentSrc ends in -150x150 or -300x… |
Template or block asks for a small size | Request a bigger size name |
| Never wider than 2560px | currentSrc ends in -scaled |
Big-image threshold | Raise big_image_size_threshold |
| Width is right, but blocky skies or skin tones | naturalWidth ≥ the target |
Re-encoding at 82/86, or compressed twice | Raise quality, compress in one place |
| Width is right, text is smeared | File is a JPEG | Screenshot saved as JPEG | Use PNG or lossless WebP |
currentSrc is on another host with resize parameters |
— | CDN or optimisation service | Fix that service's width and quality |
If naturalWidth matches the upload and the image is still soft, the source itself is soft. Nothing in WordPress can add detail back.
How WordPress builds srcset and sizes
For an image in post content, WordPress adds srcset at render time from the attachment's generated sizes (wp_calculate_image_srcset()), with three rules that explain most "no retina version" cases:
- Only sizes with the same aspect ratio as the displayed file are candidates. A hard-cropped 800×450 size has no siblings unless you also generate a 1600×900 one.
- Candidates wider than 2048px are dropped (
max_srcset_image_width), unless that file is thesrcitself. - With fewer than two candidates there is no
srcsetat all.
sizes comes from wp_calculate_image_sizes(): (max-width: Wpx) 100vw, Wpx, where W is the width of the size in src. That is why the Image block's Resolution control (the sizeSlug attribute, default Large, 1024px) matters even when srcset holds bigger files: the browser believes the slot is 1024px wide and stretches a 1024px file across a full-width row.
Since WordPress 6.7, lazy-loaded images that have a width and a sizes attribute get auto, prepended (wp_img_tag_add_auto_sizes), so supporting browsers use the real layout width instead. Images WordPress expects above the fold — typically the first in the content, which is exactly where heroes sit — are not lazy-loaded and keep the capped value. See lazy loading for how that split is made.
In a theme template, pass sizes yourself instead of relying on the default:
<?php
// Hero spanning the viewport: let srcset pick from all sizes up to 2048px.
echo wp_get_attachment_image($image_id, 'full', false, ['sizes' => '100vw']);
Make the right files exist
WordPress does not upscale. A size larger than the original in both dimensions is simply not generated, so a 900px upload has nothing to offer a 1400px slot. The default sizes and their widths are in WordPress image sizes.
For a cropped theme slot, register the size and its 2× twin with the same ratio, so srcset has two candidates (arguments in add_image_size):
<?php
add_action('after_setup_theme', function () {
add_image_size('card', 800, 450, true);
add_image_size('card-2x', 1600, 900, true);
});
Existing uploads gain new sizes only after you regenerate thumbnails:
wp media regenerate --yes
An image edited in the media editor gets a new filename with an -e plus 13-digit suffix. A block still pointing to the pre-edit file gets no srcset; reinsert the image.
The 2560px threshold
Uploads over 2560px on either side are scaled to fit within 2560px, saved with -scaled in the filename, and that copy becomes the full size; the original stays on disk but never appears in srcset. For photography or zoomable product images, raise it deliberately (resizing images covers the rest):
<?php
add_filter('big_image_size_threshold', fn () => 3840);
Returning false disables scaling. Only do that if you control upload sizes.
Compression quality and output format
Every generated size, including -scaled, is re-encoded. The default from wp_editor_set_quality is 82 for JPEG and 86 for WebP; for JPEGs the older jpeg_quality filter runs afterwards and wins. The filter receives the MIME type, so you can change one format only:
<?php
add_filter('wp_editor_set_quality', function ($quality, $mime_type) {
return 'image/jpeg' === $mime_type ? 88 : $quality;
}, 10, 2);
It affects only files generated after the change, so regenerate. Gains above about 90 are rarely visible.
By default WordPress converts only HEIC/HEIF uploads (to JPEG). A JPEG becomes WebP or AVIF only if you or a plugin set image_editor_output_format — and that conversion is another lossy pass on top of the camera's. The trade-offs are in WebP in WordPress.
Common mistakes
- Sharpening or re-exporting the original when the browser is loading a 1024px copy.
- Compressing in an optimisation plugin and again in a CDN; pick one place, as covered in optimising images.
- Registering a hard-cropped size without a same-ratio 2× size.
- Setting product image widths and forgetting to regenerate — see WooCommerce product image size.
- Using a CSS background for a hero:
srcsetdoes not apply, so useimage-set()or a file sized for the largest screen.
Verify
Purge page and CDN caches, reload, and run the Console line again on a standard screen and on a phone or a 2× display. naturalWidth should be at least clientWidth × devicePixelRatio in both. Check the file size in the Network panel at the same time: the goal is the smallest file that passes, not the largest one available.
Frequently asked
- Uploads wider or taller than 2560 pixels are scaled down to fit within 2560 and the copy, saved with a -scaled suffix, becomes the full size used on the site. The original stays on the server but is not offered to browsers. Change the limit with the big_image_size_threshold filter; returning false turns scaling off.
- 82 for JPEG and most other formats, 86 for WebP, applied to every size WordPress generates, including the -scaled copy. The wp_editor_set_quality filter changes it per MIME type, and jpeg_quality runs after it for JPEGs. Your untouched original is not re-encoded.
- It picks which generated size goes in the image's src (the sizeSlug attribute; Large by default). WordPress also builds the sizes attribute from that size's width, so a Large image in a full-width block tells the browser the slot is 1024px wide. For full-width images choose Full Size.