Bulk delete of spam accounts?

I’m running an instance for my own blog at agger — WriteFreely@Modspil.dk

Naively, I had allowed open registration back in March. Today, to my horror, I see that I now have ~1200 spam accounts.

I started deleting them through the UI, but soon gave up - it’s taking too much time.

I SSH’ed to the server and deleted some with writefreely user delete, but that’s also a pain because you have to confirm deletion each time so it’s not easily scriptable. Also the writefreely program doesn’t allow me to list all users, so it’s not easily scriptable.

Does anyone know of there is an easy way to achieve this?

Thanks in advance for any response :slight_smile:

Also, I don’t understand why the spam blogs aren’t listed on the admin dashboard. Is there something I should enable?

OK, so I found a solution I can kind of live with.

I made a small script which I named delete, like so:


echo "deleting user $1"
echo 'y' | ./writefreely user d $1

Then I copy the list from /admin/users, one page at a time (there isn’t an option for showing all users at once), insert it into a file called lusers, and then I do

for luser in $(cat lusers| cut -d ' ' -f 1); do ./delete $luser; done

This is not really ideal … EDIT: I got it done rather quickly, though, by copying the users to the file one page at a time

1 Like