Last active
January 28, 2020 08:05
-
-
Save CreativeDive/d0785e97628c7d47d19767d93428e6d8 to your computer and use it in GitHub Desktop.
Change the default WordPress image compression level.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!function_exists('wordpress_image_compression_quality')): | |
function wordpress_image_compression_quality($quality) { | |
// Default compression level | |
return 82; // <-- 100 is highest quality | |
} | |
endif; | |
add_filter('jpeg_quality', 'wordpress_image_compression_quality'); | |
add_filter('wp_editor_set_quality', 'wordpress_image_compression_quality'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Further explanation about how you can change the WordPress image compression level (DE Version)