How to Control Image Compression in WordPress

By default, WordPress compresses your images for higher efficiency. In this article, you will learn the best way to either enhance or lower JPEG compression in WordPress. Whenever you add a JPEG in WordPress, it will automatically be compressed to 90% high quality.

In WordPress 4.5 version, this quantity is decreased to 82% to enhance website efficiency for cell customers. But, you can turn-off image compression in WordPress any time by using following code:

If your website has too many graphics and you are facing page loading issue, you may want to increase the compression and decrease image quality. Following code can be used to decrease the image quality:


User Comments

3 thoughts on “How to Control Image Compression in WordPress

    David Murray says:

    Do you mean?

    add_filter(‘jpeg_quality’, ‘image_quality_increase’);

    function image_quality_increase($arg){
    return 100;

    David Murray says:

    or perhaps even without the quotes – sorry i am php newb

      Hello David,

      Yes, just add this snippet in your activated theme’s functions.php file and set the image quality value according to your needs. For more details regarding this hook, please read its documentation on WordPress Codex.

      Thanks for reaching us out. Let us know if you need any other assistance from us.


      Abdullah | WP Plugin Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

    Get in Touch