Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change JPEG compression level of image files uploaded to WordPress. Source: http://www.wpbeginner.com/wp-tutorials/how-to-increase-or-decrease-wordpress-jpeg-image-compression/
<?php
//* Prevent JPEG compression
add_filter('jpeg_quality', function($arg){return 100;});
//* JPEG compression level set to 75%
add_filter('jpeg_quality', function($arg){return 75;});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.