Answer a question

I have a strange situation. I have started my store by allowing people to check out without needing to create an account. Guest checkout So with every order, a customer was created in the customer section of the WooCommerce plugin. I no longer need those guest customers and I would like to delete. However, there is no option to do that anywhere.

WooCommerce > Customers option is introduced in WC 4

They have no users associated with them they are just customers. WooCommerce does not allow me to remove them. I have tried everything. Even external plugins that are built to manage WooCommerce users, do not detect these customers.

DELETE FROM wp_users WHERE ID NOT in (1,2)

I have even tried WP-CLI and still those customers not deleted.

Cleared wp_wc_customer_lookup still showing the same.

It's like they're hiding as metadata somewhere or something. Any ideas?

Answers

global $wpdb;
$wpdb->query( "DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_wc_report_customers_%')" );

Run this once.

Logo

WooCommerce社区为您提供最前沿的新闻资讯和知识内容

更多推荐