TIP: How to delete all your orders and save you time
-
Two days ago i had to delete all my WC orders (more than 2.000 orders) because i wanted to do a clean importation of orders.
The problem is when you have a lot of orders, you can lose hours deleting per 50 orders every time and later doing the same cleaning the trash, because more than this in the same request, the WP/Server will give you an error.
Some people propose to edit server settings, things you can’t if you’re not the owner… So, i share with you the solution and hope that saves your time:
1 – Make all orders as “trash”:
With this sql request:
update wp_posts set post_status = 'trash' where post_type = 'shop_order';
You can execute it on phpMyAdmin or from the DB plugin if you have one that lets you to execute requests, like “WP-DBManager”.
2 – Clean the trash
For this i’ve used the plugin “Quick Empty Trash”. You have only to go to the Woocomerce Trash and clique “Empty Trash”.
NOTE: IF you have a lot of orders to clean, it’s probably that you’ll have an error page seconds after clicking the “Empty Trash”. ?Don’t panic! The web will give you this error after that the plugin had cleaned about 1.000 or 2.000 orders from trash. You have just to go back to Orders page and you’ll see that the trash was cleaned for 1K-2K orders. Repeat the operation clicking “Empty Trash” if you have more orders on trash… until you clean it at all.
That’s all! You can import your saved orders or receive new orders… and the time saved you can dedicate it to something else.
Hope that helps someone.
- The topic ‘TIP: How to delete all your orders and save you time’ is closed to new replies.