Skip to content

Instantly share code, notes, and snippets.

@Hexodus
Last active August 2, 2017 10:14
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 Hexodus/680292e416fb9e43f943a31646514e9b to your computer and use it in GitHub Desktop.
Save Hexodus/680292e416fb9e43f943a31646514e9b to your computer and use it in GitHub Desktop.
Change Wordpress default image compression percentage. I'm most happy with 90% ;) Keep in mind that it applies only to new uploaded images - old ones have to be regenerated.
<?PHP
add_filter('jpeg_quality', function($arg){return 90;});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment