Website Building » WooCommerce » How Do I Hide Product Gallery in WooCommerce?

How Do I Hide Product Gallery in WooCommerce?

Last updated on January 19, 2023 @ 1:10 pm

Product galleries are a great way to show off your products and make them look more appealing to customers. However, there are times when you may want to hide the product gallery. This could be for a number of reasons, such as if you only want to show the product images on the product page, or if you want to hide the product gallery from the shop page.

There are a few different ways that you can hide the product gallery in WooCommerce. One way is to go to the WooCommerce settings page and then click on the Products tab.

From here, you will want to select the Display tab and then uncheck the box next to Enable lightbox for product images. This will disable the product gallery lightbox feature, which will effectively hide the product gallery from view.

Another way to hide the product gallery is by using a plugin. There are a few plugins that allow you to do this, such as Gallery Product for WooCommerce and WC Products Gallery. These plugins will add a new setting to your WooCommerce products where you can disable the product gallery.

If you don’t want to use a plugin, then you can also add some code to your theme’s functions.php file. You will need to add the following code:

add_action( 'wp', 'woo_hide_product_gallery' );
function woo_hide_product_gallery() {
if ( is_product() ) {
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
}

This code will remove the product gallery from the single product page. If you want to remove it from both the single product page and the shop page, then you can use this code:

add_action( 'wp', 'woo_hide_product_gallery' );
function woo_hide_product_gallery() {
if ( is_product() || is_shop() ) {
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product images', 20 );
} 

There are a few different ways that you can hide the product gallery in WooCommerce. From here, you will want to select the Display tab and then uncheck the box next to Enable lightbox for product images.

This will disable the product gallery lightbox feature, which will effectively hide the product gallery from view. Another way to hide the product gallery is by using a plugin like Gallery Product for WooCommerce or WC Products Gallery.

PRO TIP: If you are using WooCommerce to sell products on your WordPress site, you may want to hide the product gallery on the product pages. This can be done by going to the Settings > Products tab and selecting the option to "Hide Product Gallery".

However, be aware that this will also hide the product gallery on any WooCommerce pages that are displayed on your site, such as the shop page and category pages. This may make it difficult for potential customers to browse your products and could reduce your sales.

Conclusion: There are a few different ways that you can hide the product gallery in WooCommerce

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.