How to Prevent WordPress Compress Your Images

When images are uploaded, WordPress automatically sets the image compression to 90. Therefore, the quality of the images will be affected due to this image compression, but the good thing is that the file size of the images will become smaller. I know some of you may want the quality of the images and you think it is important to keep the good quality of images, then you can copy and paste the following code to your functions.php WordPress file and save it, that is so simple and you are done!

add_filter('jpeg_quality', function($arg){return 100;});

Thanks to WP Snippets for the best code!

4 Responses to “How to Prevent WordPress Compress Your Images”

  1. Platinumzone says:

    Great Article. I needed help and found this. thanks!

  2. Very helpful. Thank you!

  3. I learn a lot from this article. Its an excellent article.

  4. rohit says:

    Very nice and helpful article. Thanks.

Leave a Reply