My membership site has been flooded with spam. One thing I noticed is a lot of spammers @ hotmail.com emails.
What I want to do is delete all users who are subscribers and have an @hotmail email address.
User data is in two tables wp_usersand wp_usermeta, as far as I understand, I need to delete data in both tables in order to effectively delete users. I was unable to find a query that can delete all user data from mysql through two tables.
I can remove users from the wp_user table with this query
DELETE
FROM wp_users
WHERE user_email LIKE "%@hotmail%"
But I also need to delete the data from the table wp_usersmeta, and also make sure that I delete only subscribers ( meta_key = wp_capabilities and meta_value = subscriber).
Any ideas how I can do this? Is there any user data in any other tables that I am missing? Subscribers have no messages associated with them.
I saw some spam plugins, but they are proactive. Right now, I need a way to get rid of these annoying spammers emails.
source
share