# איך למחוק אלפי הודעות אישיות?

**URL:** https://meta.discourse.org/t/how-to-delete-thousands-of-personal-messages/162747
**Category:** Support
**Tags:** personal-messages
**Created:** [2 בספטמבר,‏ 2020,‏ 7:12am UTC](https://meta.discourse.org/t/how-to-delete-thousands-of-personal-messages/162747 "2020-09-02T07:12:42Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2 בספטמבר,‏ 2020,‏ 5:27pm UTC](https://meta.discourse.org/t/how-to-delete-thousands-of-personal-messages/162747/2 "2020-09-02T17:27:54Z")

</div>

Well, I think that this will do what you asked. It will delete any private messages that were not created by a system user or discobot. It will still delete any other private messages, including those from admins.

It’s not tested. I’m not saying that it’s a good idea. I won’t promise that it won’t do something bad.

```plaintext
cd /var/discourse
discourse backup
./launcher enter app
rails s
Topic.where(archetype: 'private_message').where("user_id > 0").destroy_all
exit
discourse enable_restore
discourse restore

```

If something bad does not happen, you can omit the last two steps. If something bad does happen, you’ll want to copy/paste the most recent backup printed by the `discourse restore` command to restore the backup.

---

_[View the full topic](https://meta.discourse.org/t/how-to-delete-thousands-of-personal-messages/162747)._
