How to Change WordPress JPEG Image Compression

WordPress by default will compress the images for the better performance. If your website is something related to photography or a gallery based site and if you are using WordPress CMS platform you don’t need this option at all. This reduces the image size but also reduces the quality of the image. So How to change WordPress JPEG Image compression? Let’s take a look at it in detail.

How to Change WordPress JPEG Image Compression

How to Change WordPress JPEG Image Compression

How to Change WordPress JPEG Image Compression

By default when you upload any JPEG image into WordPress it will compress the image to 90% quality. In the latest version of WordPress 4.5 and above this was still brought down to 82%. By reducing the quality the site loading speed will be increased and it is benefited for the mobile users mainly.

Recommended Article to read

You could either increase or decrease the compression of the Image by adding a small filter in your function.php file which is present in the theme directory.

Disable Image Compression in WordPress

Add the below code in the function.php which is present in the theme folder.

The number 100 in the above code indicates WordPress to retain the image at its highest quality when it is uploaded.

Increase the Image Compression in WordPress

If you don’t have a gallery based site and you don’t require the highest quality to be displayed then you could further increase the compression level of the image.

By doing this you might notice a little decrease in the quality of the image but if you are not a photographer the clarity is negligible. Increasing the compression level will definitely reduce the image size and increase the page loading speed.

Add the below code in the function.php which is present in the theme folder.

The number 70 in the code indicates WordPress to retain the image quality at 70% of its original image.
Once you add this filter make sure you need to regenerate thumbnails to see the changes reflected everywhere on the site.

You may also like...

Leave a Reply

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

CommentLuv badge