in WordPress

Stop Wordpress Compressing JPEG Images

Compress Whenever you upload an image to Wordpress media library it will automatically compress your images to 90% quality, this is to size a bit of bandwidth on displaying images on your web page. But if your a photographer and you want to always have the highest quality images on your site then you can change the default compression to 100% quality. All you have to add the following to your functions.php file, this will run when compressing your images and return the value of the quality you want.


add_filter('jpeg_quality', function($arg){return 100;});
add_filter( 'wp_editor_set_quality', function($arg){return 100;} );

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email