Batch operations on multiple users


(Dan Dascalescu) #1

I’ve just migrated from an older forum, and would like to trim down spam users coming from a certain set of domains:

Would be great if there was a way to have checkboexes next to the users (just like with topics), to enable batch operations (mainly, delete).


Heisenbug: can't delete user without post in rapid succession of deleting users without posts
(Jeff Atwood) #2

Generally you do this as part of the import – screening out topics and users you don’t want to arrive – not after the fact.

Most forums are chock full of shell / spam / bogus accounts that should be trimmed before they come in. Which is not too hard since they generally have no posts, either.


(Dan Dascalescu) #3

Agree, for this particular use case. In general, I think batch operations on users would be useful.

Use case: sort users descending by number of posts created, select those above a threshold, and bump their trust level - part of onboarding after a migration.


(Dan Dascalescu) #4

Reviving this topic to see if any other forum admins would have a use for this feature.

If I were to work on a PR, what would be a good start and some directions to follow? I have plenty of JS experience, but no Ruby.


Scroll through full user list?
(Erlend Sogge Heggen) #5

@riking could the rails console come to the rescue again here?


(Kane York) #6
user_list.each do |user|
  UserDestroyer.new(Discourse.system_user).destroy(user, { delete_posts: true, context: 'removing all mail.bg users' } )
end