# Delete notifications after days - suggested new setting

**URL:** https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098
**Category:** Feature
**Created:** [November 19, 2024, 9:03pm UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098 "2024-11-19T21:03:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [November 19, 2024, 9:03pm UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098/1 "2024-11-19T21:03:30Z")

</div>

Having a setting similar to the ‘delete email logs after days’ but for notifications (hard delete) would be very useful - with the default being 0 (disabled/keep forever).

Although it is nice to have a full history of notifications, the value of them decreases significantly with time and they are somewhat ephemeral. But can eat up quite significant space in the DB proportional to everything else.

From my understanding it’s quite common for social media platforms to not store notifications indefinitely - often a weeks to months range.

My poor server is being thrashed and disk space is filling up rapidly. :okay:

Hope this is considered! :content: 🙏

Reference: [2.8b notifications - is hard deleting old alerts/notifications from the database possible?](https://meta.discourse.org/t/2-8b-notifications-is-hard-deleting-old-alerts-notifications-from-the-database-possible/336638)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 20, 2024, 4:01pm UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098/2 "2024-11-20T16:01:05Z")

</div>

Does the existing `max_notifications_per_user` site setting help here? It is a hidden setting but it does a similar job, it limits the total number of notifications on an instance.

That setting by default will keep the last 10,000 notifications per user, and automatically purge the rest in a background job that runs every week. You could lower it to a smaller number (1000 maybe?) and then it’ll clean up even more aggressively.

Context via the original commit: [FEATURE: limit number of notifications per user to 10,000 · discourse/discourse@372f6f4 · GitHub](https://github.com/discourse/discourse/commit/372f6f4f221e1fe3027be32ed3f22ab6b5b22d48)

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [November 23, 2024, 9:10am UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098/3 "2024-11-23T09:10:47Z")

</div>

Thank you @pmusaraj!

That is a huge help - I was not aware about that option. Will give it a try and see how it goes!

---

<div class="post-metadata">

### Author: ![patrickemin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickemin/32/520162_2.png) [@patrickemin](https://meta.discourse.org/u/patrickemin)
#### Post date: [November 26, 2024, 2:53am UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098/4 "2024-11-26T02:53:34Z")

</div>

Hi, how can I find this setting? Thank you.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [November 26, 2024, 8:42am UTC](https://meta.discourse.org/t/delete-notifications-after-days-suggested-new-setting/337098/5 "2024-11-26T08:42:18Z")

</div>

> [@Hidden Site Settings Reference Guide](https://meta.discourse.org/t/hidden-site-settings-reference-guide/308774):
>
> bookmark This is a #reference guide for describing all available Hidden Site Settings. person_raising_hand Required user level: Administrator Hidden site settings in Discourse are advanced configuration options that are not available through the standard admin interface. They provide additional flexibility to customize the functionality of your Discourse instance. information_source For additional information about modifying hidden site settings, see: [Enable Hidden Site Settings](https://meta.discourse.org/t/enable-hidden-site-settings/308773). Be…

> [@Using Hidden Site Settings](https://meta.discourse.org/t/enable-hidden-site-settings/308773):
>
> bookmark This is a #how-to guide about Hidden Site Settings, how to enable them, and why you might want to adjust them. person_raising_hand Required user level: Administrator warning Important: Console access is required for some steps. In Discourse, hidden site settings refer to configuration options that are not readily visible or accessible through the standard admin dashboard interface. These settings are part of the backend configuration that can control various advanced or potent…
