2

I have a WooCommerce site on which I have to delete ~12000 products (and all their relations) with a list of ids from a CSV file.

Do you know a good method to do this?

I have thought to use a SQL query or a plugin... but I haven't found nothing interesting expect this old plugin that don't seems to work well : https://wordpress.org/plugins/wc-bulk-product-delete

Thank's in advance!

Huluti
  • 41
  • 5

1 Answers1

0

I dont know from the woo-commerce point of view,whether there is any internal or external tool to delete the records and its related tables.

But purely from a database point of view- I am assuming database is mysql.

1)First thing you need to do is find the table in database for which you want to delete the records.

2)Find the relations with other tables,if not then define proper relations using keys.

3)Then export the csv into database.Here is one of many links- How to import CSV file to MySQL table

Before that you should check whether the csv columns match columns of db.Else you just populate into a master kind of table and then by using it you can delete it from main tables

If relationships are properly defined then it will not be difficult to delete from other tables

Hope this helps you

Kedar Limaye
  • 1,041
  • 8
  • 15