0

I have two attributes in my variable products:

  • number of pages
  • language combination

When I deselect specific attributes, the corresponding variations keep existing and are not deleted (in the variations tab, I see "Any number of pages":

enter image description here

As I have thousands of unused variations, I would like to delete those. How can I select and delete them e.g. via phpMyAdmin? So far, I understood that all variations with selected attributes are listed in wp_term_relationships. Any help is strongly appreciated and I think this concerns many users who would like to streamline their database.

2
  • Simply go to WooCommerce > Status > Tools and click on "Delete orphaned Variations"… Note that variations with selected attributes are NOT listed in wp_term_relationships as "product_variation" post type don't handle any custom taxonomy, only the parent variable product does ("product" post type). Commented Apr 16 at 19:53
  • Thanks a lot - however, the variations I talk about are not orphaned variations. When I run your command, I get "0 orphaned variations deleted". IMO, orphaned variations have "null" as attribute values because attributes have been deleted for example. In my case, I simply deselected attribute values so that the corresponding variations don't show up on the product page anymore. In the variations tab, I see them with an "Any attributeXY" value.
    – perlfan
    Commented Apr 17 at 7:17

0