Delete Test Orders in Magento
Add to Favourites
Email This Post
|
I found it pretty crazy that, throughout my travels with Magento, I still hadn’t found a way to delete test orders. These orders were contributing towards the overall sales figures for the month, which is not ideal.
Crazily, there is not an easy way to get rid of these orders in Magento, and the Cancel button does not erase this data. However, if you have access to PHPMyAdmin, you can simply cut and paste a MySQL query that will do the job for you…
Simply paste…
set @increment_id='100000001'; select @order_id:=entity_id from prefix_sales_order_entity where increment_id=@increment_id; delete from prefix_sales_order_entity where entity_id=@order_id or parent_id=@order_id; delete from prefix_sales_order where increment_id=@increment_id;
..changing prefix_ for any database table prefix (if you use any), and 100000001 for the actual order number in question. This should successfully do the job for you.
about the author
This article was written by Sam Davis on October 15, 2008.
Computing over a glass of Grenache Shiraz... again! Sam encourages you to make money by writing articles for us! Learn More |
related articles
comments
2 Responses to “Delete Test Orders in Magento”
Leave a Reply
![]() Translate Inline - Easy Manipulation of Your Magento Store |

















































I would love to say that this sql works but it has caused major problems for us in the past. After deleting an order using this, when a new customer signs up and orders they are assigned the address from the previously deleted order and other wiered functionality.
Hi all,
For a working version of the following:
+ How to delete Magento test data
+ How to change prefix for orders, invoices, shipments, and credit memo’s
Please visit this url: http://eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/
And leave some feedback =)
We’d be glad to hear from you!
- Lee Taylor