Really usefully Magento doesn’t have as standard the ability to delete an order> You can cancel them but they still exist in the orders table!
If like me when you build a Magento site you end up with 20+ test orders and a dashboard full of useless data it is wise to remove it all before you go-live. I’ll start with the easiest things to do:
- Delete your test user accounts – if you don’t want to use them again. Go to Customers | Manager Customers, tick the check-box and delete.
- Clear out your test search terms – Go to Catalog | Search Terms, Select all and delete
- Delete the orders – there are several plugins to use, I have recently found a good one which worked on Version 1.81.0 called Raveinfosys_Deleteorder (http://www.magentocommerce.com/magento-connect/delete-orders-6.html) – Don’t forget to uninstall it after use as it can be a dangerous tool to give a client 🙂
Here’s the tricky bit… After deleting your test orders, the bestsellers data and most viewed products tabs will still be populated in the dashboard. To get rid of them run the following SQL commands in PHPMyAdmin.
This command removes the Bestsellers Data
TRUNCATE TABLE sales_bestsellers_aggregated_daily; TRUNCATE TABLE sales_bestsellers_aggregated_monthly; TRUNCATE TABLE sales_bestsellers_aggregated_yearly;
Then this command to empty most viewed
TRUNCATE TABLE `report_event`;
Then this to reset the search count
UPDATE `catalogsearch_query` SET `num_results`=0, `popularity`=0;
Your installation is now clean and ready to hand over to the client.