17Jul

Remove WordPress image compression

WordPress reduces image quality to 60% on upload when processing. However, you can override this with one line of code without a plugin.

How to change the percentage of compression for images uploaded in WordPress

Open functions.php in your theme folder and add this line

add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );

100 is the percentage of compression. You can turn this up to less if you wish. If it’s 100 it is doubly important your images are optimized for the web prior to upload to avoid slow load times.

Please note this change will not affect images you have already uploaded.

Subscribe
Notify of

0 Comments
Oldest
Newest
Inline Feedbacks
View all comments