Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento 2: How to delete all customers data?
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `amazon_customer`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_address_entity_text`;
TRUNCATE TABLE `customer_address_entity_varchar`;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_grid_flat`;
TRUNCATE TABLE `customer_log`;
TRUNCATE TABLE `customer_visitor`;
TRUNCATE TABLE `persistent_session`;
TRUNCATE TABLE `login_as_customer`;
TRUNCATE TABLE `magento_login_as_customer_log`;
TRUNCATE TABLE `wishlist`;
TRUNCATE TABLE `wishlist_item`;
TRUNCATE TABLE `wishlist_item_option`;
TRUNCATE TABLE `salesrule_customer`;
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment