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 solved this by first setting all the relevant orders to trash:
UPDATE wp_posts SET post_status = 'trash' WHERE post_type = 'shop_order';
If you have too many posts to get through when pressing Empty Trash and you get a PHP error, you can run the following SQL to remove them instead:
DELETE FROM wp_posts
WHERE post_type = 'shop_order'
AND post_status = ‘trash’