# Is there a way to remove all the deleted/hidden posts?

**URL:** https://meta.discourse.org/t/is-there-a-way-to-remove-all-the-deleted-hidden-posts/70122
**Category:** Support
**Created:** [2017 年9 月 15 日 14:59 UTC](https://meta.discourse.org/t/is-there-a-way-to-remove-all-the-deleted-hidden-posts/70122 "2017-09-15T14:59:57Z")
**Posts on this page:** 1
**Showing post:** 20

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2021 年7 月 22 日 13:37 UTC](https://meta.discourse.org/t/is-there-a-way-to-remove-all-the-deleted-hidden-posts/70122/20 "2021-07-22T13:37:17Z")

</div>

你无法通过界面完成这一操作（如果你所说的“轻松”是指这个的话），但我想你可以编写一个简单的 Rails 脚本来循环遍历并选择已软删除的帖子，然后对它们执行任意操作，例如将内容替换为“[deleted]”，如下所示：[If I want to completely delete a post, I should just hide them? - #14 by j127](https://meta.discourse.org/t/if-i-want-to-completely-delete-a-post-i-should-just-hide-them/56720/14?u=canapin)  
或者使用 `.destroy` 彻底删除它们：[If I want to completely delete a post, I should just hide them? - #12 by Canapin](https://meta.discourse.org/t/if-i-want-to-completely-delete-a-post-i-should-just-hide-them/56720/12?u=canapin)

---

_[View the full topic](https://meta.discourse.org/t/is-there-a-way-to-remove-all-the-deleted-hidden-posts/70122)._
