# Bulk edit users - remove moderator privilege

**URL:** https://meta.discourse.org/t/bulk-edit-users-remove-moderator-privilege/183523
**Category:** Support
**Created:** [March 17, 2021, 12:48pm UTC](https://meta.discourse.org/t/bulk-edit-users-remove-moderator-privilege/183523 "2021-03-17T12:48:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Antony](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antony/32/204487_2.png) [@Antony](https://meta.discourse.org/u/Antony)
#### Post date: [March 17, 2021, 12:48pm UTC](https://meta.discourse.org/t/bulk-edit-users-remove-moderator-privilege/183523/1 "2021-03-17T12:48:17Z")

</div>

After running an import seems that the script has given moderator privileges to half of the users.

I didn’t get a chance to see what DB structure looks like, so if someone would kindly help me adapt this

User.where(“is\_moderator”).update\_all(is\_moderator: false)

Thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 17, 2021, 1:44pm UTC](https://meta.discourse.org/t/bulk-edit-users-remove-moderator-privilege/183523/2 "2021-03-17T13:44:24Z")

</div>

That’s pretty close… Maybe this is it?

```
 User.where(moderator: true).update_all(moderator: false)

```

You can do something like

```
 User.last

```

To see the properties.

---

<div class="post-metadata">

### Author: ![Antony](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antony/32/204487_2.png) [@Antony](https://meta.discourse.org/u/Antony)
#### Post date: [March 17, 2021, 5:02pm UTC](https://meta.discourse.org/t/bulk-edit-users-remove-moderator-privilege/183523/3 "2021-03-17T17:02:54Z")

</div>

Thanks, it did the trick 🙂

For anyone needing this, here is the full procedure.

```plaintext
./launcher enter app
# rails c
# User.where(moderator: true).update_all(moderator: false)

```
