skip to Main Content

This Website (digitalzakka.com) has been migrated, but the first product image is repeated.

enter image description here

There are no duplicates in the product gallery.

enter image description here

I also set a product image:

enter image description here

The product image and product gallery may be duplicated.

I have 10,000 products, is there any way to solve this problem in batches?

2

Answers


  1. It is happening because you have added images in two places. First in the product featured image and second one in the product gallery images.

    If you add some product in the product featured image you do not need to add that image in the product gallery image. So just remove that image from gallery and check it out.

    Login or Signup to reply.
  2. If you want to do it in batches then a simple solution is to remove featured images from woocommerce products. Try the following code:

    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;
    }
    

    I ran into the same issue. I solved it through the above code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search