Is there a way to delete inactive users? Lets say inactive means a user last seen 1 year ago, without any post.
AI-generated summary
The discussion revolves around the ability to automatically or bulk delete inactive users in Discourse. hosna initiated the conversation, seeking a way to delete users who have been inactive for a year without any posts. Thomas_G suggested manual deletion, but hosna clarified that they were looking for an automatic or bulk method.
codinghorror proposed a safe definition for inactive users: last seen 1 year ago, no posts, and less than 15 minutes of total account read time (TL0). hosna agreed with this definition and questioned the value of retaining inactive users.
The conversation led to nbianca submitting a pull request for this feature, which now includes a 2-year default limit for safety codinghorror. hosna inquired about the option to change the default limit and requested a webhook call when a user is deleted.
codinghorror suggested adding a site setting to adjust the time limit. Deanan_DaSilva expressed concern about the feature’s ability to purge users without a reminder and asked about undoing deletions. Stephen advised that deleted users can only be recovered if no changes have occurred since the last backup and emphasized the importance of testing changes on a staging site before applying them to a live instance.
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:
I’m aware of how to delete a user manually. I was looking for kind of automatic or bulk way.
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)
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? ![]()
@nbianca can you add that to your list. Low pri.
It’ll need to have a LONG default for safety. Like two years.
Another advantage of having this ability is to free up short usernames that are taken by inactive users.
I submitted a PR about this:
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?
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.
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.
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.
This is complete thanks @nbianca!