Automatic/Bulk deleting inactive users

(hosna) #1

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

2 Likes
#2

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:

(hosna) #3

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

(Jeff Atwood) #4

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

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)
7 Likes
(hosna) #5

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

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? :thinking:

4 Likes
(Régis Hanol) #6

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

3 Likes
(Jeff Atwood) #7

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

4 Likes
(hosna) #8

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

5 Likes
(Bianca) #9

I submitted a PR about this:

6 Likes
(hosna) #10

Thats great :smiley: . 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?

2 Likes
(Jeff Atwood) #11

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.

5 Likes
(Deanan Da Silva) #12

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.

(Stephen) #13

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.

(Jeff Atwood) #14

This is complete thanks @nbianca!

(Jeff Atwood) closed #15