Image zooming is a default feature automatically enabled with WooCommerce.
Zooming into a product image is often necessary to see more critical details. However, it’s unnecessary in other cases, and we should disable it.
This article will show you how to disable the zoom and lightbox preview for WooCommerce products.
Paste the functions below inside the functions.php file of your child theme. Please remember to back up your website before editing core files.
Disable Image Zoom in WooCommerce
We are all know and familiar with the zoom effect that every WooCommerce store has.
Hovering over a product image will enlarge the item to view it bigger.
To disable the zoom feature on single product pages in WooCommerce, navigate to Appearance -> Theme File Editor and paste this code at the bottom of the functions.php file.
remove_theme_support( 'wc-product-gallery-zoom' );
Once saved, refresh the product page and verify that the zoom feature was disabled successfully.
Keep reading if you’re interested in keeping the zoom option but want to disable the lightbox feature.
Disable Product Lightbox in WooCommerce
When clicking on a product’s image, the lightbox feature will open it in a gallery view.
That will help customers to get see more details about the desired item.
However, not all products need it, and the lighbox modal can be disabled easily.
Disabling the lightbox modal in WooCommerce is a simple process similar to the one above (image zoom).
From your WordPress dashboard, navigate to Appearance -> Theme File Editor, and paste this code at the bottom of the functions.php file.
remove_theme_support( 'wc-product-gallery-lightbox' );
Once saved, revisit the product page and click on the product’s image to ensure it was disabled successfully.
This article showed you how to easily disable zoom and lightbox for WooCommerce products.
If you would like to reverse the process in the future, delete the codes above from the functions file.
Please comment and tell us if you have any questions about the process.
Also, make sure to subscribe to our YouTube channel and like our page on Facebook.