
When developing or testing a new Shopware 6 shop, it can be necessary to completely remove all existing orders and customers completely. In this article, we show you how to do this safely and quickly using SQL.
Why isn't deletion possible through the backend?
Shopware 6 stores orders in an audit-proof way. Direct deletion via the admin panel is not intended for legal and structural reasons. However, especially for test systems or after a data import, a complete reset is often necessary.
SQL commands: Delete all orders
SET FOREIGN_KEY_CHECKS=0;
DELETE FROM order_delivery_position;
DELETE FROM order_delivery;
DELETE FROM order_line_item;
DELETE FROM order_transaction;
DELETE FROM order_address;
DELETE FROM order_customer;
DELETE FROM `order`;
SET FOREIGN_KEY_CHECKS=1;
SQL commands: Delete all customers
SET FOREIGN_KEY_CHECKS=0;
DELETE FROM customer_address;
DELETE FROM customer_tag;
DELETE FROM customer_wishlist_product;
DELETE FROM customer;
DELETE FROM user_config WHERE user_id IN (SELECT id FROM customer);
SET FOREIGN_KEY_CHECKS=1;
Tip:
After that, be sure to refresh the search index: bin/console dal:refresh:index
Warning: Only use on test systems
These commands permanently delete all customer and order data. Use them only on development environments or after importing test data.
Conclusion:
With the SQL commands above, you can quickly reset your Shopware 6 system and create a clean data baseline for go-live or further testing. For developers, agencies, and shop operators, this is a valuable step in the deployment workflow.
Need support with the technical management or development of your Shopware 6 shop? eazyCode Software GmbH is your reliable partner for tailor-made e-commerce solutions, custom Shopware development, and high-performance system optimization. Whether it's setup, data cleanup, interface integration, or long-term support – we guide you from concept to successful live operation.

Need support with the technical management or development of your Shopware 6 shop?
eazyCode Software GmbH is your reliable partner for tailor-made e-commerce solutions, custom Shopware development, and high-performance system optimization. Whether it's setup, data cleanup, interface integration, or long-term support – we guide you from concept to successful live operation.