I recently had a few hundred spam accounts registered on my board. The one common attribute among all the accounts is that they entered "Man" in the biography profile field. Is there a SQL query I could run that would delete all these accounts? The mass/prune users feature has a very limited search. Thank you.
SQL query to mass delete users based on Biography data
Collapse
X
-
If there is some common value within their user table records then you can query the table to set yourself up to prune by group, like this:
The biography is stored in the joined userfield table and I don't have a query for that. If no one else here has a query for you then the people on www.vbulletin.org might be able to help. -
If anyone could help us figure this out it would be greatly appreciated. I tried for hours and searched for many more. The best I could come up with is this
Code:UPDATE user LEFT JOIN userfield ON user.userid = userfield.userid SET usergroupid = '25' WHERE userfield.field1 = 'man'
Code:error number: 1054 error desc: Unknown column 'userfield.field1' in 'where clause'
Comment
-
When I run that query I get what is shown in the attached image. (sorry I couldnt paste the text due to the formatting).
I am able to run a basic query that lets me know there is over 1k users with biography man, I just cant seem to move them to the new banned usergroup.
I appreciate the helpComment
-
Thanks for the quick reply. Its encouraging to know it should be working.
Something I havent told yet is I have the vb prefix on my database. This is exactly what I am putting in the query.
Code:UPDATE vbuser LEFT JOIN vbuserfield ON user.userid = userfield.userid SET usergroupid = '25' WHERE userfield.field1 = 'man'
Comment
-
Thanks alot, for some reason it wont work for me if I use vbusergroupid, I have to leave it as usergroupid
here is the final code for anyone who wants it:
Code:UPDATE vbuser LEFT JOIN vbuserfield ON vbuser.userid = vbuserfield.userid SET usergroupid = '25' WHERE vbuserfield.field1 = 'man'
Comment
-
Hope to help. For who using vbulletin 4, the command is more clean, no 'vb' in front of user, so:
UPDATE
user
LEFT JOIN
userfield
ON
user.userid = userfield.userid
SET
usergroupid = '12'
WHERE
userfield.field1 = 'man'
Change 'man' with anything else your spammer wrote in the profile field
Change '12' with your spamers usergroup.
Great people here, found what I need and finished with bot spam. Thanks!CRISTIAN C. - BMWforum adminComment
-
Glad to see someone has found a way to fix this problem. I'm very thankful that these spammers/bots were considerate enough to use the same "Man" entry in the Biography field, but I couldn't figure out how to mass prune them all, until finding this thread. One question though...If I have some legitimate users with "man" somewhere in that field, such as a user with 2,000 posts whose biography is "Manager of yadda yadda", will it delete them as well? Or does the use of single apostrophes in the script above only target those whose fields are "man" and nothing else? I need a definitive answer to this, because the last thing I want to do is to prune legitimate users, especially very active ones.Comment
-
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment