# Change all posts by user to wiki

**URL:** <https://meta.discourse.org/t/change-all-posts-by-user-to-wiki/49298>\
**Category:** Support\
**Tags:** wiki-posts\
**Created:** [26.Август.2016 20:05:27 UTC](https://meta.discourse.org/t/change-all-posts-by-user-to-wiki/49298 "2016-08-26T20:05:27Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [26.Август.2016 23:16:30 UTC](https://meta.discourse.org/t/change-all-posts-by-user-to-wiki/49298/7 "2016-08-26T23:16:30Z")

</div>

```plaintext
u = User.find_by_username('abc')
Post.where(user: u).each do |p|
  p.wiki = true
  p.save
end

```

---

_[View the full topic](https://meta.discourse.org/t/change-all-posts-by-user-to-wiki/49298)._
