# \[Solved\] Deleting Posts to Get Back Under 10,000

**URL:** <https://forum.mattermost.com/t/solved-deleting-posts-to-get-back-under-10-000/25971>\
**Category:** Troubleshooting\
**Created:** [June 28, 2026, 7:28pm UTC](https://forum.mattermost.com/t/solved-deleting-posts-to-get-back-under-10-000/25971 "2026-06-28T19:28:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfbl](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@kfbl](https://forum.mattermost.com/u/kfbl)\
**Post date:** [June 28, 2026, 7:28pm UTC](https://forum.mattermost.com/t/solved-deleting-posts-to-get-back-under-10-000/25971/1 "2026-06-28T19:28:47Z")

</div>

**Summary**  
Is it possible to delete posts to get back under the 10,000 message limit in the Team edition?

**Observed behavior**  
I had an automated webhook that went wild and sent about 40,000 messages in the span of a couple hours, which caused me to hit the 10,000 message limit and now I can’t see any posts older than today in any channel. I ran a command in my Postgres DB to mark the messages as deleted, but I haven’t actually removed any entries because I’m afraid of causing instability if I do. And so far, doing so doesn’t appear to have restored my past messages. Is there a safe way to do it, and would it actually restore my other messages? Or delete and recreate the channel? Here’s the command I ran:

```sql
UPDATE posts SET deleteat = (EXTRACT(EPOCH FROM NOW()) * 1000) WHERE channelid = 'Automation_Channel_ID' AND deleteat = 0;

```

---

<div class="post-metadata">

**Author:** ![kfbl](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@kfbl](https://forum.mattermost.com/u/kfbl)\
**Post date:** [August 3, 2026, 1:16am UTC](https://forum.mattermost.com/t/solved-deleting-posts-to-get-back-under-10-000/25971/2 "2026-08-03T01:16:52Z")

</div>

Follow up:

I tried the SQL command from my original post and waited a long time for built-in garbage collection to do it’s thing, but no luck. I ended up deleting all of the posts in that channel:

```sql
DELETE FROM posts WHERE channelid = 'Automation_Channel_ID';

```

If you’re familiar with SQL, you can customize the above command with a WHERE clause to further limit the chat record deletions.

The iOS app is still not displaying old messages, even after removing all app data and logging out and back in. But I can confirm the desktop app is now displaying messages again. If it doesn’t return soon, I’ll try wiping the app from my phone and reinstalling it. EDIT: “Reinstalling worked! Finally have all my old messages.”

I also ran the following commands before checking the desktop app - not sure if it was required or not:

```sql
UPDATE channels SET totalmsgcount = 0 WHERE id = 'Automation_Channel_ID';
UPDATE channels SET totalmsgcountroot = 0 WHERE id = 'Automation_Channel_ID';

```

So far, I haven’t noticed any side effects, but your mileage may vary. Hope this helps someone in the future!

---

<div class="post-metadata">

**Author:** ![wxue1011](https://avatars.discourse-cdn.com/v4/letter/w/5f9b8f/32.png) [@wxue1011](https://forum.mattermost.com/u/wxue1011)\
**Post date:** [September 14, 2026, 7:06am UTC](https://forum.mattermost.com/t/solved-deleting-posts-to-get-back-under-10-000/25971/3 "2026-09-14T07:06:14Z")

</div>

I tested, in teams edition there is no resctriction about 10000 msgs. In entry edition there is.
