• Hi. Recently, I noticed that all my images are lower quality after I upload them on my website. I found out that WordPress automatically compresses images, which I want to turn off or disable. I looked online and tried putting many variations of a code, but none of them worked. Even the SMNTCS plugin (which supposedly adds the code) didn’t work either.

    I tried “add_filter(‘jpeg_quality’, function($arg){return 100;}); add_filter(‘wp_editor_set_quality’, function($arg){return 100;});”

    “add_filter(‘jpeg_quality’, function($arg){return 100;});”

    and some other variations in my functions.php, but none of them work. After I upload an image, I open it in full-size and I can immediately see the quality went down. How can I turn off wordpress’s automatic image compression?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there! Do you happen to be using the Jetpack plugin for hosting your images? This could be a reason why the function code didn’t work. If you use Jetpack, try disabling the Site Accelerator.

    I haven’t used this plugin personally, but I have heard that the Perfect Images plugin is recommended, as it can disabling automatic image scaling.

    If you have any questions about either of these plugins, please see their dedicated support forums (Jetpack and Perfect Images), as you can get more focused help there. Good luck!

    Thread Starter phoenixblue

    (@phoenixblue)

    Thanks for the reply. I don’t use Jetpack, and I tried Perfect Images before and it didn’t work. I think maybe because it needed Pro version for full-sized pictures.

    I think I found a code that finally worked, but I will wait and see (sometimes it seems to work, then the next day the image is blurry again). This code seems to work for now:

    function custom_jpeg_quality( $quality, $context ) {
    return 100;
    }
    add_filter( ‘jpeg_quality’, ‘custom_jpeg_quality’, 10, 2 );

    Thread Starter phoenixblue

    (@phoenixblue)

    Nevermind, after a few hours, it went back to being blurry again. It makes no sense. I didn’t optimize or do anything afterwards. It just goes back to being blurry.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to disable WordPress automatic image compression?’ is closed to new replies.