# Unlisting a topic in the ruby console

**URL:** https://meta.discourse.org/t/unlisting-a-topic-in-the-ruby-console/107060
**Category:** Development
**Tags:** unlisting
**Created:** [January 21, 2019, 3:25am UTC](https://meta.discourse.org/t/unlisting-a-topic-in-the-ruby-console/107060 "2019-01-21T03:25:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [January 21, 2019, 3:25am UTC](https://meta.discourse.org/t/unlisting-a-topic-in-the-ruby-console/107060/1 "2019-01-21T03:25:36Z")

</div>

How do you unlist a topic in the ruby console?

---

<div class="post-metadata">

### Author: ![sau226](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sau226/32/302324_2.png) [@sau226](https://meta.discourse.org/u/sau226)
#### Post date: [January 21, 2019, 6:10am UTC](https://meta.discourse.org/t/unlisting-a-topic-in-the-ruby-console/107060/2 "2019-01-21T06:10:27Z")

</div>

You do so through the rails console that comes with discourse.

Get a rails console open (in a normal install run this as root on your server)

```plaintext
cd /var/discourse
./launcher enter app
rails c

```

Execute below query where 11 is the topic ID visible in the URL bar (this topic’s ID is 107060)

```ruby
Topic.where(id: "11").find_each do |topic| topic.update_status("visible", false, Discourse.system_user) end

```

The system user will unlist the topic.
