HummingbirdUK main logo

HummingbirdUK

Coding solutions to business problems

About us

We use code to create solutions to business challenges, bottle-necks and headaches.

If you think your business has a problem that can be solved through code, we are happy to chat things through without any obligation.

Get in touch

Clear out test data from a Magento store

Home / Blog / Clear out test data from a Magento store

Written by Giles Bennett

So - you've got your transactional emails set up, your shipping is working, your payment method is all sorted and you're ready to launch your Magento store to the world. Except you've got a load of junk cluttering up the place from your testing. Here's the quick and easy guide on how to delete test data from Magento to declutter the store so it's nice and clean ready for your first customers!

Clear out test orders

Surprisingly, Magento doesn't come with the ability to delete orders...you can credit memo which will mark them as cancelled, but it doesn't remove them from the order list, and their data will still show up in reports. The best module out there, that I've found, is EM Seamless Delete Order (not the greatest of names), which is available on Magento Connect here, and which can be installed through the Magento Downloader. Once installed it adds an option to the bottom of the Mass Actions menu in the order list (in Sales / Orders), so you can bulk select any test orders and delete them with a single click.

Clear out test customers

Simple enough - go into Customers / Manage Customers, select all, and delete.

Clear out test search terms

Also simple enough - go into Catalogue / Search Terms, select all, and delete.

Clear out bestsellers and most viewed products on the dashboard

You'll need database access for this, ideally, through PHPMyAdmin or your database editor of choice. Once in the database you need to execute SQL commands to truncate a number of tables to clear the bestsellers' lists : [php]TRUNCATE TABLE sales_bestsellers_aggregated_daily; TRUNCATE TABLE sales_bestsellers_aggregated_monthly; TRUNCATE TABLE sales_bestsellers_aggregated_yearly;[/php] And then one more command while you're there to clear out the list of most viewed products : [php]TRUNCATE TABLE `report_event`;[/php] And finally, one more to reset the search count to zero : [php]UPDATE `catalogsearch_query` SET `num_results`=0, `popularity`=0;[/php] And that's it - you're good to go!
Author : Giles Bennett

About the author

Giles Bennett built his first website in 1996, and is old enough to miss Netscape Navigator. Initially a lawyer, he jumped ship to IT in 2008, and after 5 years as a freelancer, he founded HummingbirdUK in 2013. He can be reached by email at giles@hummingbirduk.com.