Adjust WordPress JPEG Resize Quality

snippet, Wordpress, , Leave a comment

Got your latest images pixelated after uploading it to WordPress? Yes, that could be irritating especially on Photography sites.  WordPress has a function to adjust the level of the image quality, as described on Developer Code Reference.

Simply put this small code to your functions.php

function update_jpeg_quality( $quality, $context ) {
	return 100;
add_filter( 'jpeg_quality', 'update_jpeg_quality' );

Adjust return number to set the level of compression.

100 = No Compression applied. Change it moderate compression about 80. Anything below 80 will make your images looks pixelated but produced a minimum of file size.