Step 1: Open functions.php file

Open the WordPress admin dashboard of your WooCommerce store and head on to Appearance > Theme editor from the left sidebar.

Once you are in the Theme Editor page, you can see a text editor in the middle and list of files in your theme on the left side.

From the theme files, click on functions.php file.

Now you can see your theme’s functions.php file opened on the text editor screen in the middle of the page.

Step 2: Copy the following code snippet

add_filter('woocommerce_single_product_image_thumbnail_html', 'remove_featured_image', 10, 2);
function remove_featured_image($html, $attachment_id ) {
    global $post, $product;

    $featured_image = get_post_thumbnail_id( $post->ID );

    if ( $attachment_id == $featured_image )
        $html = '';

    return $html;
}

 

Step 3: Add the code snippet to functions.php

Now go back to the Theme Editor screen in the WordPress admin area. In the first step, you have opened the functions.php file on the text editor.

Click anywhere on the text editor and scroll to the bottom of the funcitons.php file and paste the above code at the end.

Step 4: Save changes

Click on the Save changes button at the bottom of the text editor screen. Now you have successfully added the code snippet required to hide product featured image from the product image gallery on single product pages.

Summary

Sometimes you may don’t want to show the product featured image in the product image gallery in the single product page but there WooCommerce doesn’t provide you the option do configure your store that way. However, it is not difficult to achieve what you want. All you need to add a small snippet to of PHP code to the functions.php file on your theme.