How to Change WordPress JPEG Image Compression

WordPress compresses your images by default, for the better performance in all kind of device. In this article, we are describing that “how can increase or decrease JPEG image compression in WordPress.”

WordPress JPEG compression setting only applies to those derivative thumbnail versions which created when uploading images to the media library.

Whenever you upload a JPEG image in WordPress, it would automatically compress the image to 90% quality. This number was decreased compression ratio to 82% in WordPress 4.5 and WordPress 5.0, to improve site performance for mobile users.

For fix this problem there are two ways are available in WordPress.

  1. First option is to edit your theme’s function.php file and add the following line, and fix that problem.
  • add_filter(‘jpeg_quality’, function($arg){return 70;});

You can set the quality as you want.

For example, if you want to want 85% quality then change the value of the return. add_filter(‘jpeg_quality’, function($arg){return 85;});

When you do make these image quality changes, at that time you have to make sure that you regenerate your thumbnails.

  1. Second option is to install the WP Resized Image Quality

If you don’t want to edit your function.php then this Plugin installation will do the work for you and helps you to fix your image compress problems.

Leave A Reply