Created
May 15, 2023 10:46
-
-
Save philipjohn/5d8d3b98abbedec0bf38bee0fd254606 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Delete all users with a role of "subscriber" from a WordPress database. | |
# | |
# Assumes the `wp_` table prefix | |
DELETE FROM wp_users WHERE ID IN ( SELECT user_id FROM wp_usermeta WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%' ); | |
DELETE FROM wp_usermeta WHERE user_id IN ( SELECT user_id FROM wp_usermeta WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment