# Prevent deleting of abandoned, unactivated accounts?

**URL:** <https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237>\
**Category:** SSO\
**Created:** [2017年十月17日 00:14 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237 "2017-10-17T00:14:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgoetz](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kgoetz](https://meta.discourse.org/u/kgoetz)\
**Post date:** [2017年十月17日 00:14 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/1 "2017-10-17T00:14:34Z")

</div>

Hi,

I’m looking to disable a number of SSO users.

The topic below confirms only those with no posts will be deleted (good), but I’m hoping to prevent _all_ users created/synced via sso from being deleted in discourse no matter what their post count.

> [@Can I restore a deleted user?](https://meta.discourse.org/t/can-i-restore-a-deleted-user/65765):
>
> Is there a way to restore a user who was Automatically deleted as abandoned, deactivated account? Background I migrated from another forum. I required all users to reset their passwords. It took at least one of the users longer that 14 days (the default grace period) to Activate their account. Now they cannot log in to reset their password. I’m concerned because many others probably fall into this scenario. I’ve since extended the Grace Period setting.

I do want discourse to keep deleting spam/invalid accounts.

Is such a thing possible?

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [2017年十月17日 06:56 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/2 "2017-10-17T06:56:53Z")

</div>

You can hide `delete` button for all users using HTML customization.

---

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [2017年十月17日 09:23 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/3 "2017-10-17T09:23:16Z")

</div>

Set the site setting `purge unactivated users grace period days` to `0` to never purge unactivated users automatically 🙂

---

<div class="post-metadata">

**Author:** ![kgoetz](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kgoetz](https://meta.discourse.org/u/kgoetz)\
**Post date:** [2017年十月21日 03:53 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/4 "2017-10-21T03:53:27Z")

</div>

> [@vinothkannans](#):
>
> You can hide delete button for all users using HTML customization.

Hi Vinoth!,  
Thanks for the suggestion. In my case its the Discourse system user that I need to modify the behaviour of so I suspect I’ll need something lower level.

> [@fefrei](#):
>
> Set the site setting purge unactivated users grace period days to 0 to never purge unactivated users automatically 🙂

My understanding is that setting will stop Discourse (system user) from deleting spam accounts - is that the case?

thanks again to both of you,

---

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [2017年十月21日 08:32 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/5 "2017-10-21T08:32:55Z")

</div>

> [@kgoetz](#):
>
> My understanding is that setting will stop Discourse (system user) from deleting spam accounts - is that the case?

This is only about users that registered but never activated their account by clicking the link in the email they got – it has nothing to do with spam per se 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2019年十一月29日 05:24 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/6 "2019-11-29T05:24:05Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2023年九月3日 21:23 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/7 "2023-09-03T21:23:30Z")

</div>



---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年九月3日 23:06 UTC](https://meta.discourse.org/t/prevent-deleting-of-abandoned-unactivated-accounts/72237/8 "2023-09-03T23:06:48Z")

</div>


