I have a Wordpress site with thousands of editors. I cant delete them from the WP dashboard as its to slow.
I need a query to delete all the editor users and their posts from PhpMyAdmin?
Thanks
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI have a Wordpress site with thousands of editors. I cant delete them from the WP dashboard as its to slow.
I need a query to delete all the editor users and their posts from PhpMyAdmin?
Thanks
It's a three step process.
First, get a list of Editors using WP_User_Query
.
Get a list of each user's posts using get_posts
and delete them using wp_delete_post
.
Lastly, delete the user itself using wp_delete_user
.