How to improve JPG quality in WordPress

When you’re building a website speed is important. And part of that is keeping your images as small as possible.

But you’re a photographer. For your site good enough is just not good enough. For the tip today we’re going to bump the quality setting that WordPress uses when resizing JPG files from the default of 90% to 100%.

The Code

To make this work it’ll take a bit of code. You’re going to want to add this to the functions.php file inside your theme folder.

add_filter( 'jpeg_quality', 'pb_jpeg_quality' );
function pb_jpeg_quality() {
	return 100;
}

And that’s it. Once the code is there WordPress will save any JPGs that it creates at 100% instead of 90%.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>