Create Beautiful Responsive Photo & Video Galleries For Your Site in Minutes

Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

How to remove WordPress image compression

Would you like to remove the default image compression that WordPress applies to your uploaded images? WordPress automatically applies image compression to each image uploaded to your site.

This tutorial will walk you through how to turn off image compression with the use of simple code snippets.

Heads up!

This article contains PHP, CSS, and/or JavaScript to customize our plugin. We offer this code as a courtesy but don’t provide support for additional code customizations or 3rd party development.

To remove WordPress Image Compression, you’ll need to add the following code.

If you need help adding custom code to your site, please check out our guide on adding custom PHP or JavaScript to your site.

/* Envira - Remove WordPress Image Compression
* 
* @link https://enviragallery.com/docs/how-to-remove-wordpress-image-compression/
*/
add_filter('jpeg_quality', function($arg){return 100;});

Once code has been added, any new image uploaded will no longer be subject to WordPress’ image compression!

Note: Any image that was uploaded before enabling this code snippet will need to be re-uploaded to have the compression removed.

That’s it! Would you like to extend Envira further? Check out our tutorial on how to Remove Fragment Cache from Envira Gallery.

The Best Drag and Drop WordPress Gallery Plugin

Envira Gallery: Create, Showcase, and Sell Your Work – Trusted by 150k+ Sites.

Enter the URL of your WordPress website to install

Please enable JavaScript in your browser to complete this form.

Upgrade to Envira Gallery Pro

Unlock even more powerful features designed to make your galleries even more beaituful.

Video Galleries

eCommerce

Social media Sharing

Adobe Lightroom

And much more!

Copyright © [#this year :%Y] Envira Gallery, LLC. Envira Gallery is a trademark of Envira Gallery, LLC.