How to Disable Product Image Zoom, Lightbox and Product Gallery Slider in Woocommerce

Woocommerce 3+ have built in image zoom Lightbox and product images gallery feature. Most of us love this feature, however, some people would like to remove it.

Disable Image Zoom feature on the single product page in WooCommerce

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

Disable Image Lightbox feature on the single product page in WooCommerce

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.

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

Disable Product Gallery Slider feature on the single product page in WooCommerce

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

PHP code snippet

In order to disable product Product Image Zoom, Lightbox and Product Gallery Slider, simply paste this snippet into your functions.php file, within the theme folder.

Only add the specific code which you need to remove from your single product page.

add_action( 'wp', 'tr_remove_single_product_image_support', 99 );
   
function tr_remove_single_product_image_support() { 
   remove_theme_support( 'wc-product-gallery-zoom' );
   remove_theme_support( 'wc-product-gallery-lightbox' );
   remove_theme_support( 'wc-product-gallery-slider' );
}

About The Author

1 thought on “How to Disable Product Image Zoom, Lightbox and Product Gallery Slider in Woocommerce”

  1. hi Tawfiq, could you please help me with single product image view, when i checked it on wide screen the image zoom 2 times than the original and i noticed some code capture image original size but can we make a fixed size for images and thumbnail, im currently using porto theme for woocomerce

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top