I have a lot of spam profiles on my WordPress website. They're linking to their spam sites using their profiles (homepage and description).
That is a good method to recognize them. Normal users don't write long AI generated texts with links on their profiles.
How can I bulk delete them (or first find them) with sql?
The data can be found in the wp_usermeta table in the meta_key description.
I tried this:
SELECT meta_key FROM `wp_usermeta` WHERE description != '';
but got this error message:
#1054 - Unknown column 'description' in 'where clause'
Seems that I don't understand the structure of this table at the moment.
Can you help me?
Thanks.
The correct working SQL query is:
Instead of searching in the database, you could filter users that have a description from admin users list, and then Bulk delete them.
The code displays a new button called "Spam" in admin users list, that filter users that have a description (see the screenshot below).
Try the following:
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.
Addition: Display trimmed description in WordPress Users List custom column
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.