We have more than 900.000 spam users! and they haven't any role. We want to delete all spam users and their meta.
In this answer and this link we can delete users based on role but our spam users doesn't have any role.
This query return real users:
SELECT user_id FROM wp_usermeta WHERE meta_key = 'wp_capabilities'
In usermeta
spam users doesn't have capabilities
key.
We want remove spam users with database query.
for resolve you can use subquery and in operator