Delete All Zero Order Customers WooCommerce

Created by WP Fix It, Modified on Sun, 3 Aug at 6:10 AM by WP Fix It

SQL to run below (change table name to your prefix)


DELETE from wp_users where wp_users.ID not in (
	SELECT meta_value FROM wp_postmeta WHERE meta_key = '_customer_user'
) AND wp_users.ID not in (
	select distinct(post_author) from wp_posts
)LIMIT 1000;

delete from wp_usermeta where wp_usermeta.user_id not in (select ID from wp_users)
LIMIT 1000;

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article