Forked from BronsonQuick/wp_cli_command_to_delete_all_woocommerce_users
Last active
March 31, 2022 07:22
-
-
Save dompl/764b7407e93dd42f761c75bf01b034fd to your computer and use it in GitHub Desktop.
WP-CLI command to delete all WooCommerce users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp user list --field=ID --role=customer | xargs wp user delete --yes | |
wp post list --field=ID --post_type=shop_order --posts_per_page=2000 | xargs wp post delete --force | |
wp post list --field=ID --post_type=products --posts_per_page=2000 | xargs wp post delete --force | |
wp post list --field=ID --post_type=posts --posts_per_page=2000 | xargs wp post delete --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment