Skip to content

Instantly share code, notes, and snippets.

@jpmarchand
Last active May 31, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpmarchand/5b44f95ead34c6309a09 to your computer and use it in GitHub Desktop.
Save jpmarchand/5b44f95ead34c6309a09 to your computer and use it in GitHub Desktop.
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