G
G
Gennick's Macleo2019-05-22 19:42:11
Image optimization
Gennick's Macleo, 2019-05-22 19:42:11

How to disable image compression in WooCommerce&WordPress?

I ran into this issue after posting product photos in the WooCommerce catalog. Not only that, when uploading images to the catalog, WordPress itself compresses these images by 15%, plus WooCommerce starts to compress them later and compresses decently, which is immediately visually noticeable. I didn’t find the answer anywhere, so I contacted the WooCommerce developers and they sent me an option on how to disable automatic image regeneration, so I’ll leave this one here, suddenly it will come in handy for someone:
add_filter( 'woocommerce_background_image_regeneration', '__return_false' );
Just in case, disabling WP image compression:
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
By the way, restoring compressed images is not possible using WooCommerce, so developers recommend using third-party plugins.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Kobzarev, 2019-05-28
@mihdan

Usually helps

add_filter( 'woocommerce_background_image_regeneration', '__return_false' );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question