# 오래된 귓속말을 일괄 삭제하는 방법

**URL:** https://meta.discourse.org/t/how-to-bulk-delete-old-whispers/175945
**Category:** Support
**Tags:** whispers
**Created:** [1월 13, 2021, 6:47오전 UTC](https://meta.discourse.org/t/how-to-bulk-delete-old-whispers/175945 "2021-01-13T06:47:55Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [1월 13, 2021, 7:34오후 UTC](https://meta.discourse.org/t/how-to-bulk-delete-old-whispers/175945/2 "2021-01-13T19:34:25Z")

</div>

게시글을 삭제하는 가장 깔끔한 방법은 다음과 같습니다:

```ruby
whispers = Post.where(post_type: 4).where("created_at < ?", 1.year.ago)

whispers.find_each do |w|
  PostDestroyer.new(Discourse.system_user, w, skip_staff_log: true).destroy
  putc "."
end

```

이 코드는 System 사용자가 각 게시글의 삭제 버튼을 통해 수동으로 삭제한 것과 동일한 효과를 냅니다. 스태프 로그가 오염되지 않도록 `skip_staff_log`를 포함했지만, 해당 작업을 로그에 남기고 싶다면 이 부분을 제거할 수 있습니다.

이 방식이 요구사항을 충족할까요?

---

_[View the full topic](https://meta.discourse.org/t/how-to-bulk-delete-old-whispers/175945)._
