# إلغاء تفعيل جماعي للمستخدمين غير النشطين

**URL:** <https://meta.discourse.org/t/bulk-deactivation-of-inactive-users/64562>\
**Category:** Support\
**Created:** [15 يونيو 2017، 4:26م UTC](https://meta.discourse.org/t/bulk-deactivation-of-inactive-users/64562 "2017-06-15T16:26:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![codechef](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codechef/32/90261_2.png) [@codechef](https://meta.discourse.org/u/codechef)\
**Post date:** [20 يونيو 2017، 5:12م UTC](https://meta.discourse.org/t/bulk-deactivation-of-inactive-users/64562/5 "2017-06-20T17:12:05Z")

</div>

Quick follow up. This script worked perfectly! I tested it in a demo environment first.

Two minor suggestions:

1. I added “and active = true” to the where criteria because I wasn’t sure if there’d be side effects to deactivating an inactive user.
2. People that come across this post is the future may want to consider adding “and id \> 0” to prevent updating the system and discobot users (though I didn’t do this myself because they were within my last\_seen\_at window.) It doesn’t appear that their last\_seen\_at is updated after the accounts are created.

---

_[View the full topic](https://meta.discourse.org/t/bulk-deactivation-of-inactive-users/64562)._
