How to bulk delete status.net users

Whoops ... had a play with status.net, didn't notice that I'd left registration enabled, came back and found I had 19K users chatting away about dental insurance, hotel bedding and kitchen aids.

In the status.net web interface users are deleted from their user page (one at a time), but there's an easy way to bulk remove them via CLI using 'deleteuser.php' in the scripts folder. There is also an issue in Status.NET project tracker to add bulk user delete.

My real user a/cs had user IDs 1, 2, 3, so this query blows away all users with higher IDs in a MySQL DB named "statusnet". Adjust to taste.

for ii in $( mysql -ss -e 'select id from user where id > 3' statusnet ) ; do php ./scripts/deleteuser.php -y -i$ii ; done

Several thousand spammers were deleted while I typed this post ... it's not instant, but it's pretty quick!

If you're in the same boat (a private Status.NET installation which is receiving unwanted registrations), set this in your config.php -

$config['site']['closed'] = TRUE;

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <code> <br> <h2> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.