Topic on Project:Support desk

Deleting multiple users

10
Jonathan3 (talkcontribs)

I'd like to be able to delete nearly every user on my wiki - probably "every user which has never made an edit" - or "every user who has only edited his own user page".

Is there an extension that could do this? Or a tried-and-tested SQL query?

Thanks in anticipation.

AhmadF.Cheema (talkcontribs)

The most appropriate way to achieve something similar is by way of Extension:UserMerge. The more customized solutions, either don't exist or are likely to be very unreliable.

Jonathan3 (talkcontribs)

Thanks. That extension doesn't look useful for removing (or merging) hundreds of users. Its page has a link to Extension:BlockAndNuke but that's not maintained and from the talk page looks not to be working with the latest MW version.

Jonathan3 (talkcontribs)

Back to SQL, do you think the following would work? The intention would be to delete every user from the user table who has never made a revision which appears in the revision table.

DELETE 
FROM wm_user 
WHERE user_id NOT IN (SELECT DISTINCT rev_user FROM wm_revision)

There are no pages in the User or User Talk namespaces to worry about having to delete.

Jonathan3 (talkcontribs)

@Samwilson I saw you reply to another message about users, and wondered if you would be able to help with my (SQL) query above. Thanks in anticipation.

Samwilson (talkcontribs)

I'd recommend against trying to do this directly with SQL. It's really likely to be a headache.

I suspect that getting the BlockAndNuke extension up to date would be easier, and result in a more reliable solution that's more usable by more people. :)

(I might have a look at it this weekend...)

Deimos (talkcontribs)

>> every user which has never made an edit

Well, this is simple. Just run the maintenance script 'RemoveUnusedAccounts.php' - Manual:RemoveUnusedAccounts.php

This post was hidden by 94rain (history)
Jonathan3 (talkcontribs)

Thank you very much. I'll look into it as soon as I get a chance! Because of the settings on my wiki, the spam accounts get created but don't edit pages, so this looks like the right solution for me.

Meanderpaul (talkcontribs)

i know zombie thread and stuff. I ran the removeUnusedAccounts.php and found and removed over 88k users. (got a massive spam attack and have since added captcha)

when i go onto mu wikipage and view user lists it still hows 1000s of users that need to be removed. is there another option for getting rid of them? as a bonus if you can remove pages that they made under the talk option.

Reply to "Deleting multiple users"