How to Change or Disable Image Compression in WordPress (2026)
Uploaded a sharp, high-resolution photo to WordPress, only to find it looks soft or slightly blurry in your post? WordPress image compression is the reason. By default, WordPress re-saves the resized copies of every JPEG you upload at 82% quality, and it also scales down very large images. Here’s how to change or disable image compression in WordPress in 2026, with copy-ready code, and when you should leave it on.

Quick answer: Add add_filter( 'wp_editor_set_quality', function() { return 90; } ); to your theme’s functions.php or a code snippets plugin to change WordPress image compression (use 100 to effectively turn it off). New uploads will use the new quality; regenerate thumbnails to update older images.
Table of Contents
How WordPress image compression works
- Resized copies are compressed. When you upload a JPEG, WordPress creates thumbnail, medium and large sizes and saves them at quality 82 (on a scale of 0 to 100). Older WordPress versions used 90.
- WebP and AVIF too. WordPress also supports WebP and, since version 6.5, AVIF images, and applies a quality setting to their resized copies (WebP defaults to a slightly higher quality than JPEG).
- Big images are scaled. Since WordPress 5.3, any image wider or taller than 2,560 pixels is automatically scaled down, and the scaled version is used on your site (the original is kept as a backup).
- PNG images are lossless, so WordPress doesn’t apply a quality setting to them, but PNG files are much bigger.
For most blogs the defaults are a good balance between quality and speed. If you run a photography site, sell products with detailed photos or share drone and landscape shots, you may want higher quality.
How to change WordPress image compression
Add one of these snippets to your child theme’s functions.php file or, more safely, with a code snippets plugin so it survives theme updates. The main WordPress hook is wp_editor_set_quality, which applies to all image formats. The older jpeg_quality hook still works for JPEGs.
Set a higher quality (less compression)
add_filter( 'wp_editor_set_quality', function( $quality ) {
return 90;
} );Disable compression (maximum quality)
add_filter( 'wp_editor_set_quality', function( $quality ) {
return 100;
} );Increase compression (smaller files)
add_filter( 'wp_editor_set_quality', function( $quality ) {
return 70;
} );Different quality for JPEG and WebP
add_filter( 'wp_editor_set_quality', function( $quality, $mime_type ) {
if ( 'image/webp' === $mime_type ) {
return 80;
}
return 90;
}, 10, 2 );Stop WordPress scaling large images
To keep images larger than 2,560 pixels at their full size, add:
add_filter( 'big_image_size_threshold', '__return_false' );Or change the limit, for example to 4,000 pixels:
add_filter( 'big_image_size_threshold', function() {
return 4000;
} );Be careful: very large images can slow your site down and use a lot of storage.
Apply the new settings to existing images
These filters only affect images uploaded after you add them. To update older images, use a plugin like Regenerate Thumbnails to recreate all image sizes with the new quality.
Should you turn off WordPress image compression?
Compression matters for speed. Large images are often the biggest part of a page and directly affect your Core Web Vitals and Google rankings. Instead of switching compression off completely, most sites do best with:
- A quality of 82 to 90 for JPEGs.
- Uploading images at the size you need, not straight from a 50-megapixel camera.
- Serving WebP or AVIF images, which are much smaller than JPEG at the same quality.
- Avoiding double compression: if you compress images before uploading, or use an image optimisation plugin, raise WordPress’s own quality so images aren’t compressed twice.
Frequently asked questions
Does WordPress compress images automatically?
Yes. WordPress saves the resized copies of uploaded images at a default quality of 82 for JPEG (slightly higher for WebP), and scales images larger than 2,560 pixels.
Does WordPress compress the original image?
The original file is kept, but if it’s larger than 2,560 pixels WordPress shows a scaled copy on your site. Smaller originals aren’t re-compressed, but the thumbnail, medium and large sizes are.
Why are my WordPress images blurry?
Usually because WordPress is showing a resized and compressed copy, or a small image size is stretched to fit a wide layout. Raise the quality, upload larger images and choose the “Full Size” or “Large” size in the editor.
Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →Get our free weekly email: new tech guides and tools, no spam.
New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.
One email a week. Unsubscribe anytime. See our privacy policy.





