# Help Wiping all Posts from a Forum

**URL:** <https://meta.discourse.org/t/help-wiping-all-posts-from-a-forum/46367>\
**Category:** Support\
**Created:** [2016 年 6 月 23 日午後 6:56 UTC](https://meta.discourse.org/t/help-wiping-all-posts-from-a-forum/46367 "2016-06-23T18:56:59Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2018 年 1 月 7 日午後 12:58 UTC](https://meta.discourse.org/t/help-wiping-all-posts-from-a-forum/46367/7 "2018-01-07T12:58:46Z")

</div>

The easiest way is to use rails command line, ssh into your server and then

```plaintext
cd /var/discourse
./launcher enter app
rails c
Post.where("user_id > 0").where(post_number: 1).find_each do |post| 
  PostDestroyer.new(Discourse.system_user, post).destroy
  putc "."
end

```

**⚠ be sure to make a backup before running this destructive code.**

---

_[View the full topic](https://meta.discourse.org/t/help-wiping-all-posts-from-a-forum/46367)._
