Skip to content
Advertisement

Bulk remove product variation images in Woocommerce

in Woocommerce (3.5.1 in my case), is it possible to remove all variation-specific images, so the image doesn’t change when the user chooses a variation in the product page ?

I want this

enter image description here

instead of that

enter image description here in the whole site.

Advertisement

Answer

You can bulk remove all product variation images bulk making a direct SQL query using phpMyAdmin for example (before backup your database):

JavaScript

Or you can use this light SQL query in a custom built-in function to remove all the variations images (or optionally only to a related parent variable product ID):

JavaScript

Code goes in function.php file of your active child theme (or active theme).

USAGE (before backup your database):

  1. For all variations images in bulk you will add to your function.php file:

    JavaScript

    Then save and browse any page of your site. Then remove it once finish.


  1. For one specific variable product (let say variable product ID 72):

    JavaScript

    Then save and browse any page of your site. Then remove it once finish.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement