I am currently in the process of removing over 2k emails that have .ru in their email or .ru in their username and it is taking longer than expected using WordPress innate bulk delete option. Is there a better way.
I did find that you can use (wp user delete) somehow, but it is not coming to me on how to use this to JUST delete these .ru related emails/usernames.
[https://wordpress.org/plugins/cleantalk-spam-protect/](https://wordpress.org/plugins/cleantalk-spam-protect/) has a feature to delete spam users, and from memory can bulk delete them.
Prevention is better than cure – set up Cloudflare, and create a WAF rule to block countries that only have spam/malicious users, like China, Russia, etc.
You can use WP-CLI for this:
`wp user list –field=ID –email=*.ru | xargs wp user delete –reassign=1 –yes`
**–reassign=1** where 1 is your admin id. This is just to reassign any posts made by a deleted user.
Another way you could do this is to just run a sql query. There are plugins you can use to run a sql query against your database or you can run it in phpMyAdmin. Make sure you do a backup, just in case.
`DELETE FROM wp_users`
`WHERE user_email LIKE ‘%@%.ru’;`
.ru in their username:
`DELETE FROM wp_users`
`WHERE user_login LIKE ‘%.ru%’;`
For the future, use some kind of spam protection. Turnstile (free) works well against bots. OOPSpam (paid) is also great for both bots and manual spam.
If you are comfortable with going into the database, you can do it that way.