• Resolved phoenixblue

    (@phoenixblue)


    Hi. This isn’t completely related to oceanwp, but I was wondering if anyone can help me? I noticed that every photo I uploaded on WordPress is lower quality (automatically compressed by WordPress). I tried adding many variations of codes in the functions.php of oceanwp, but none of them work. Do you know a code I can add that will remove WordPress’s automatic image compression?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @phoenixblue,

    There are some methods to turn it off.
    To disable WordPress’s automatic image compression, you add the following code to the function.php file:

    function disable_image_compression() {
      add_filter('jpeg_quality', '__return_false');
    }
    add_action('init', 'disable_image_compression');

    Also, you can use the following code for specific file types:

    function disable_image_compression_for_jpg() {
      add_filter('jpeg_quality', '__return_false', 10, 2);
    }
    add_action('init', 'disable_image_compression_for_jpg');

    Another method is using a third-party plugin(s) for this. So you can search in the WordPress repository to find a plugin to do this: https://wordpress.org/plugins/.

    Furthermore, this feature is available in some optimizer plugins. You can find this feature by checking the plugin features if you are probably using one of them.

    I hope it helps.
    Best Regards

    Thread Starter phoenixblue

    (@phoenixblue)

    Thanks for the reply. I don’t know why but it still doesn’t work for me. I added the code, but when I upload a photo, it still looks blurrier than the original. I tried a plugin that also didn’t work.

    Sometimes, it seems to work, then after a while, the picture goes back to being blurry. It makes no sense.

    Thread Starter phoenixblue

    (@phoenixblue)

    Update: I solved my problem. Apparently, my hosting company was compressing my images without my knowledge. They had a CDN feature auto enabled that was compressing my images. I turned it off, and everything is fine now.

    I’m glad that you were able to resolve that.

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

The topic ‘Remove WordPress Image Compression?’ is closed to new replies.