Keep WordPress from Compressing JPGs

A little known WordPress feature is WordPress’ image compression. While this is a handy feature to help increase the speed of your website, not all website owners want their images compressed – like photographers for example. Thankfully, turning off this feature is quick and easy. Simply add the following to your WordPress theme’s functions.php file.

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

Source: WordPress JPEG Thumbnail Image Quality Setting and Adjustment

Increase WordPress Site Speed with JPG Compression

Need to squeeze a few extra kilobytes off your images to speed up your WordPress website? This handy snippet can be used to compress your JPGs to speed up your WordPress website. As long as you’re fine with lower quality images for the sake of smaller file sizes, less data transfer, and faster load time, then use the following snippet to compress uploaded JPG images.

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

Keep WordPress from Compressing JPGs with a WordPress Plugin

Don’t want to mess with WordPress code? No problem. The WordPress Plugin PhotoJAR: Base keeps WordPress from compressing JPGs as well as provide a few other nifty features, like dynamic resizing and caching of thumbnails, custom image sizes, gallery of galleries, maximum size setting for full size images, an [image] shortcode, and more.

Don’t know how to install WordPress plugins? Check out our video tutorial showing how to use WordPress plugins.

Follow wpLifeGuard

« Back to Blog