Disable Product Image Zoom

Disable Product Image Zoom in Woocommerce

Woocommerce 3+ have built in image zoom feature, When you hover a product image on the single product page, you can zoom on the products images; Most of us love this feature, however, some people would like to remove it.

For Number of reasons such as You are selling something which doesn’t need to use Zoom effect.

In order to disable product Image Zoom, simply paste this snippet into your functions.php file, within the theme folder:

remove_theme_support( 'wc-product-gallery-zoom' );

This one line magic code will disable image zoom feature on the single product page in WooCommerce.

Disable WooCommerce Lightbox

Lightbox is a feature which let you click on any images and open the image gallery in WooCommerce. This is a great feature if you are selling something where the user needs to see images closely.

And if you don’t like this feature in general or simply want to disable for any other reason add the following code in theme’s functions.php file

remove_theme_support( 'wc-product-gallery-lightbox' );

As always I must remind everyone, Please only use the child theme for all customization. Otherwise, You will lose all the changes after theme update. Or use code snippets plugin

If having any issue with the above snippet let us know in the comments below.

2 Comments

  1. Hello. I used these two lines of code into the snipets plugin. The lightbox feature was removed, clicking on the product image does not open anything now. Great.
    But whenever I hover the mouse over the active image, I can see wordpress zooming in around 1 or 2 pixels (I see the image sliding to the sides just a tiny bit, its annoying). I can’t seem to get rid of this behavior. I could just set the product image a bit smaller, but we already have 1500 product images uploaded, so that is not an option. I just want to hover the mouse over the image and nothing happen. No clicking (done) and no zooming either. Thanks

Leave a Reply