How to Delete Magento Orders
Building site for online shopping, store owners usually perform lots of in-development operations that involve testing if this or that part of the show is ready and working properly. So after you have installed your Magento, established the store catalog with category tree and goods, selected template, you might need to test if payment transactions are working as expected. For that you create a few test orders.
Do you know what you will see in ‘Orders’ section after you launch your site? Your test orders and no ‘Delete Order’ button.
Does Magento Allow Delete Orders?
Magento insists on the orders to be stored, instead of completely removed. You can only set orders status to ‘cancelled’, but cannot delist it completely. This can be quite frustrating both to developers and the merchants. While the decision to limit orders removal makes sense, as they contain customers payment information and deleting it is considered as a fraud. Magento cares about buyers’ safety and limits the ability to do illegal things even by mistake.
Magento Delete Orders Workarounds
Sure thing, that if you are reading this article, you would love to see a “Delete Orders” functionality. So what to do? Are there any workarounds to remove order?
Yes, there is the possibility to remove test orders (and only only for that reason!)
There are multiple tips on different forums, but the main thing not to forget using them is:
Solution 1: Tackle the Problem Right in Database
1) Delete orders from PhpmyAdmin
To do so, you have to log on your PhpmyAdmin (use full access). Empty all the database tables related to order by running raw queries.
2) Write script
You need to create/find/modify php script and run it from corresponding section of Magento.
Things to consider:
- For the above solutions you need to have tech skills or at least know and where to paste a piece of code.
- Almost all of these methods refer to delete all orders that will suit for you in case you already have real orders.
Solution 2: Avoid Dangerous Operations in Database
Deleting orders directly in the database can be very dangerous, because Magento has a very complex database structure and many database tables that are linked together. If you do some incorrect move and delete some important for Magento data in one table, this may affect the entire database. So, what to do?
Use Store Manager for Magento application. Using it you do not need to be a developer of tech expert and avoid the direct intervention into the database which, by the way, may be harmful.
Download Store Manager for Magento! Delete Orders FREE
Once Store Manager is installed at your PC, go to Orders section, select unwanted orders and press ‘Delete’ button.
Now, selected test orders are removed from your Magento store and it will be in a clean state to start over.
Save your working hours and efforts! Remove test orders without coding! Try FREE
Magento 2 Abandoned Cart Recovery via Followup Emails
Guides on how to get the list of customers with abandoned carts and send them an email reminder using a specific template. Read More...
Just had a chance to use your solution and it worked like a charm. Before I was trying some scripts, but they always returned me with errors. Finally, I don’t have to delete many tables in many times. Is there something like that to clear up all test customer accounts and product data in one go safely? Can your tool help me to modify payment method, shipping and handling information for multiple orders in bulk? I will share the link with my merchants or development partners who asks about deleting test transactions. Thanks!
Thank you for your comment. Glad that tutorial was helpful.
Removing orders you clear related info on the customer, who placed it. However, since one person can make a few orders, to delete clients' accounts massively, go to Customer section of Store Manager. There select client records to be removed and press 'Delete' button.
Check this screen-capture: