One friend of mine asked me how to remove around 16,000 spam users with Role of “None”.
I tried several methods which includes:
None of them works, till found this snippet
delete from wp_users where ID not in (select user_id from wp_usermeta where meta_key = 'wp_capabilities') delete from wp_usermeta where user_id not in (select ID from wp_users)
You can excute the snippet from phpMyAdmin or using this plugin: https://wordpress.org/plugins/run-sql-query/