# Automatic/Bulk deleting inactive users

**URL:** https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248
**Category:** Feature
**Created:** [3월 11, 2019, 7:54오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248 "2019-03-11T07:54:43Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [3월 11, 2019, 7:54오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/1 "2019-03-11T07:54:43Z")

</div>

Is there a way to delete inactive users? Lets say inactive means a user last seen 1 year ago, without any post.

---

<div class="post-metadata">

### Author: ![Thomas\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_g/32/200158_2.png) [@Thomas\_G](https://meta.discourse.org/u/Thomas_G)
#### Post date: [3월 11, 2019, 8:03오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/2 "2019-03-11T08:03:18Z")

</div>

Hey there,

You can do it manually by heading to their profile, go to the persons’ admin panel, head all the way down until you find a `Delete User`.

* * *

Not sure about inactive users, but there are many topics to search for regarding the same question. I found this one:

[https://meta.discourse.org/t/new-signups-who-never-validate-email-deleted-after-7-days/22736/5?u=thomas\_g](https://meta.discourse.org/t/new-signups-who-never-validate-email-deleted-after-7-days/22736/5)

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [3월 11, 2019, 8:05오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/3 "2019-03-11T08:05:10Z")

</div>

I’m aware of how to delete a user manually. I was looking for kind of automatic or bulk way.

---

<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: [3월 11, 2019, 8:13오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/4 "2019-03-11T08:13:41Z")

</div>

I wouldn’t actually mind having this functionality built into Discourse, but it is not popular because it “decreases” user count metrics.

> [@hosna](#):
>
> inactive means a user last seen 1 year ago, without any post.

That seems like a fairly safe definition, _except_ what if this user had a bunch of read time? I’d say you need to limit it to

- last seen 1 year ago
- no posts
- user at TL0 (less than 15m total account read time)

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [3월 11, 2019, 8:17오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/5 "2019-03-11T08:17:47Z")

</div>

> [@codinghorror](#):
>
> user at TL0 (less than 15m total account read time)

Absolutely. this is also a good limit for inactive user.

> [@codinghorror](#):
>
> because it “decreases” user count metrics

I don’t know how inactive users might increase any value to the forum. I mean who cares if we have a million of inactive users? 🤔

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [3월 11, 2019, 8:47오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/6 "2019-03-11T08:47:33Z")

</div>

@nbianca can you add that to your list. Low pri.

---

<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: [3월 11, 2019, 8:49오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/7 "2019-03-11T08:49:26Z")

</div>

It’ll need to have a LONG default for safety. Like two years.

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [3월 11, 2019, 8:52오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/8 "2019-03-11T08:52:01Z")

</div>

Another advantage of having this ability is to free up short usernames that are taken by inactive users.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [3월 14, 2019, 10:00오후 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/9 "2019-03-14T22:00:04Z")

</div>

I submitted a PR about this:

[https://github.com/discourse/discourse/pull/7172](https://github.com/discourse/discourse/pull/7172)

---

<div class="post-metadata">

### Author: ![hosna](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosna/32/99969_2.png) [@hosna](https://meta.discourse.org/u/hosna)
#### Post date: [3월 14, 2019, 10:17오후 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/10 "2019-03-14T22:17:58Z")

</div>

Thats great 😃 . where is the option to change the default 2 years limit? And btw can we also do a webhook call when a user is deleted?

---

<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: [3월 14, 2019, 10:47오후 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/11 "2019-03-14T22:47:25Z")

</div>

Oh yes there should be a site setting to adjust the time limit here @nbianca for sure. 2 years is still a good safe default of course.

---

<div class="post-metadata">

### Author: ![Deanan\_DaSilva](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanan_dasilva/32/134585_2.png) [@Deanan\_DaSilva](https://meta.discourse.org/u/Deanan_DaSilva)
#### Post date: [5월 1, 2019, 4:05오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/12 "2019-05-01T04:05:11Z")

</div>

Is there a way to undo the delete?  
This feature purged a bunch of users that we’d have preferred to have emailed out a reminder to first.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [5월 1, 2019, 4:23오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/13 "2019-05-01T04:23:16Z")

</div>

No, unless no changes have occurred since your last backup.

It’s highly advisable to consult the release notes before applying any updates, and in addition I would strongly recommend you run all changes through a staging site before touching a live instance.

---

<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: [5월 4, 2019, 2:09오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/14 "2019-05-04T02:09:50Z")

</div>

This is complete thanks @nbianca!

---

<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: [5월 4, 2019, 2:09오전 UTC](https://meta.discourse.org/t/automatic-bulk-deleting-inactive-users/111248/15 "2019-05-04T02:09:53Z")

</div>


