removing bbpress spam users with no active site role with SQL
I’ve inherited a site that used to run bbpress. Apparently it was overrun with spammers in the 2009 timeframe and, even though the previous admin removed bbpress and stopped using it, there are 36,486 rows in the wp_users table, with only 4.290 that actually have roles on the site. Looking over the users with no roles through wp-admin, I can see these IDs are truly bogus.
There does not appear to be consistency of meta_keys in wp_usermeta for users with no roles and users WITH roles on the site. With 1,825 pages of users, scrolling through and deleting them that way would/could take hours so I want to write a SQl statement that will drop all users without roles from the database, just to clean things up.
Has anyone done this before? How can I structure a SQL query that will isolate and remove all IDs and the associated meta data for users with no site role?
Thank you so much, in advance, for any ideas or suggestions that are helpful.
I asked the same question at wordpress.org forum and was directed to ask here. The link from that thread is:
- You must be logged in to reply to this topic.