# 用标题中的关键字搜索已删除的主题

**URL:** <https://meta.discourse.org/t/searching-for-deleted-topics-with-a-keyword-in-title/173271>\
**Category:** Support\
**Created:** [2020年十二月14日 18:24 UTC](https://meta.discourse.org/t/searching-for-deleted-topics-with-a-keyword-in-title/173271 "2020-12-14T18:24:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)\
**Post date:** [2022年二月21日 10:39 UTC](https://meta.discourse.org/t/searching-for-deleted-topics-with-a-keyword-in-title/173271/8 "2022-02-21T10:39:19Z")

</div>

请查看此查询并根据需要进行修改。

> [@Delete deleted-posts permanently in bulk?](https://meta.discourse.org/t/delete-deleted-posts-permanently-in-bulk/203289/57):
>
> Excellent, glad to hear that did the job for you. So for the sake of combining the answers, one can use the following in the Rails console to destroy all topics that were deleted more than 90 days ago, repeating as many times as necessary if there are more than 1000 topics: Topic.with\_deleted.where(deleted\_at: ...90.days.ago).limit(1000).destroy\_all After that has completed, the following can be used to destroy all posts that have been orphaned from destroyed topics: Post.find\_by\_sql("select …

---

_[View the full topic](https://meta.discourse.org/t/searching-for-deleted-topics-with-a-keyword-in-title/173271)._
