Need to increase or decrease your Wordpress Jpg compression?

  • Pin It
  • Pin It

For some reason Wordpress does not seem to give you an option to increase or decrease the JPG compression ratio in the media settings. This means your scaled images are stuck at the default compression ratio. The default is 90%. This is quite high and on high resolution, high quality images, this is not going to be noticable. If you are finding your images are too slow to load, 60% is a good balance of quality verse speed, but it will be a noticable quality difference. Sometimes though even 90% is really not good enough and you need to increase the quality, or your images are just too slow to load and you need to decrease it.

At this time there are only two ways I know of to increase or decrease the quality.

1. Use a plugin

If you are not confident editing your theme, the easiest way is to use a plugin like this one. It creates an admin page with a slider for you to adjust the compression. Some other plugins just increase the quality to 100% without adding any adjustable settings.

2. Adjust it in your theme functions.php file

If you are confident editing your theme then it is possible to set the quality in your theme's functions.php file. It's just a matter of adding this snippet in (or if it already exists, editing it):

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

This snippet will set the quality to 100%. If you would like to go with a lower quality setting, just change the number from 100 to the percentage you would like.

Just remember: higher quality images = slower loading time. Lower quality images = faster loading time.