# Batch operations on multiple users

**URL:** https://meta.discourse.org/t/batch-operations-on-multiple-users/26351
**Category:** Feature
**Created:** [March 15, 2015, 8:35am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351 "2015-03-15T08:35:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [March 15, 2015, 8:35am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/1 "2015-03-15T08:35:36Z")

</div>

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

 ![](https://global.discourse-cdn.com/meta/original/3X/c/6/c6d54c757cf56703a7d519897e4d79bd91ab47a5.png)

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).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 15, 2015, 9:03am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/2 "2015-03-15T09:03:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [March 15, 2015, 9:05am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/3 "2015-03-15T09:05:32Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [February 20, 2016, 7:37am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/4 "2016-02-20T07:37:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [February 20, 2016, 11:22am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/5 "2016-02-20T11:22:40Z")

</div>

@riking could [the rails console come to the rescue](https://meta.discourse.org/t/best-way-to-combine-merge-categories-when-importing-topics/21353/2) again here?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [February 20, 2016, 10:31pm UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/6 "2016-02-20T22:31:03Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [December 12, 2024, 9:15am UTC](https://meta.discourse.org/t/batch-operations-on-multiple-users/26351/7 "2024-12-12T09:15:24Z")

</div>

Checkboxes to bulk delete users were added in  
[https://github.com/discourse/discourse/pull/29744](https://github.com/discourse/discourse/pull/29744)
