Do you want to change JPEG image compression in WordPress to improve your site performance? If yes, you have come to the right place. This blog provides you with a worthy solution to tackle this blog. Now, check them out.

Why should you stop WordPress from Compressing JPEG Images?

By default, WordPress Media Library will compress uploaded jpeg images to 90% of their original quality. Even in WordPress 4.5, your images will be compressed to 82% to boost your site performance.  Although this functionality helps you free up server space, faster page loading time, and save your hosting bandwidth, it will be not useful for websites that specialize in displaying and providing images such as photography websites, designer websites. Because it can make your images have lower quality than you desire.

Therefore, it is necessary for you to stop WordPress from compressing JPEG images to maintain the quality of your uploaded images.

How to Disable WordPress JPEG image compression

If you would like to absolutely retain 100% quality of your images after uploading them to WordPress Media Library. Disabling image compression is a great solution.

To do that, you simply add the following code into the function.php file of your theme or in a site-specific plugin.

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

This code will ensure that WordPress will keep the original quality of your image.

How to increase image compression in WordPress

There is no denying that compressing images also give your website better performance. If your website doesn’t rely on images, you should change image compression to speed up your site.

You can increase image compression by changing the number from 100 to 80 or even lower. All you need to do is add the following code.

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

After pasting this code into the function.php file of your theme, then you need to regenerate your thumbnails so that you can see the result of your custom image compression settings in WordPress.

Wrap up

Honestly, changing image compression in WordPress brings many benefits for your website. However, in some situations, you need to prevent WordPress from compressing JPEG images to keep the quality of your images. Hopefully, our blog gave you a useful solution to assist you to change JPEG image compression in WordPress. If you have any problems, feel free to leave a comment below.

Moreover, you can drop by our Website to discover a collection of beautiful, responsive Photography WordPress Themes. They are valuable for your successful website. Don’t ignore them.

5/5 - (1 vote)
Lt Digital Team (Content &Amp; Marketing)

Summer Sale Grab 50% Off for everything on today, don't miss it. Coupon code: SUMMER2024 Redeem Now
Summer Sale Grab 50% Off for everything on today, don't miss it. Coupon code: SUMMER2024 Redeem Now