Skip to content
Advertisement

how to delete completed orders in woocommerce using a my sql query

I want to delete completed all orders in woocommerce by using a single my sql query. Because, I’m having a problem with my WordPress Dashboard. I can’t view the completed orders from the back-end. It’s getting blank. I have 7,823 Completed Orders. I hope that’s why I seen white page when I’m going to view the Completed Orders.

Is there have a way to, That I can delete all Completed Orders using MySQL query. So, that I can run it in PHPMYADMIN.

Have any suggestions.

Advertisement

Answer

Woocommerce orders are stored in the post table, postmeta table, woocommerce_order_items, and woocommerce_order_itemmeta tables. Various parts of an order are stored in different tables. addition to that the order status is managed through the taxonomies which stores the order status list.
Anyone who is/will be writing this query have to write at least 5-6 queries minimum or
single large join query.

So, my suggestion to you should uninstall WooCoommerce, if you don’t have much larger product setup. To do this you can follow this link which will delete the data

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