# I can't delete a category or topic description

**URL:** https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737
**Category:** Support
**Created:** [9월 8, 2018, 1:19오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737 "2018-09-08T13:19:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 8, 2018, 1:19오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/1 "2018-09-08T13:19:37Z")

</div>

I have no clue what happend but for some reason i just can’t delete category or its topic…

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [9월 8, 2018, 9:38오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/2 "2018-09-08T21:38:26Z")

</div>

Hi @sevos, I think you should provide more context into what you’re trying to do, which is your permission level, what the logs say, etc. Otherwise nobody will be able to help you.

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 9, 2018, 4:31오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/3 "2018-09-09T16:31:58Z")

</div>

When I try to delete a category, I get this error: “Can’t delete this category because topic count is 1.”. Okay, gotcha.

When I try to delete a topic, I can’t see this option:

 ![obraz](https://global.discourse-cdn.com/meta/original/3X/c/b/cb276d1b6e56c14489c794d5bcc9ac294867373b.png)  
 ![obraz](https://global.discourse-cdn.com/meta/original/3X/2/5/2556a870b7d9c10c9c0f9f430433c1c8e83f4502.png)

Logs:

![obraz](https://global.discourse-cdn.com/meta/optimized/3X/9/0/90442d5dcb95aa92368cf856183e7c7db17f312d_2_690x30.png)

Details:

```
TypeError: Cannot read property 'reopen' of undefined
at https://XXX/t/XXX/17:193:22

```

and

```
TypeError: Cannot read property 'reopen' of undefined
    at https://XXX.XXX/t/XXXX/17/5:193:22

```

I have full admin rights.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [9월 9, 2018, 6:02오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/4 "2018-09-09T18:02:45Z")

</div>

I can see “o kategorii” which translates to “about the category”.

If the topic was generated by the Discord plugin, did you uninstall the plugin before trying to delete the topic?

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 9, 2018, 6:08오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/5 "2018-09-09T18:08:27Z")

</div>

> [@Mittineague](#):
>
> If the topic was generated by the Discord plugin, did you uninstall the plugin before trying to delete the topic?

It wasn’t generated by the plugin, i created this category by myself. But good try tho 😕

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [9월 10, 2018, 5:07오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/6 "2018-09-10T17:07:26Z")

</div>

Topic seems to be archived but not closed. Maybe you need to “Unarchive Topic” or “Close Topic” before you can delete it?

The javascript error might require a full page reload to go away.

Another way would be to move the topic somewhere else so your topic count goes to zero.

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 10, 2018, 5:21오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/7 "2018-09-10T17:21:11Z")

</div>

Okay, it’s no longer archived and i closed this topic. I tried also move this to the another topic. Nothing helped 😕

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 10, 2018, 6:55오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/8 "2018-09-10T18:55:16Z")

</div>

How can I delete this category in the (rake) console?

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [9월 11, 2018, 10:27오전 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/9 "2018-09-11T10:27:53Z")

</div>

I don’t know exactly, you need to check with a team member, but you can at least see how it looks like:

```plaintext
root@demo ~ # cd /var/discourse
root@demo /var/discourse # ./launcher enter app
root@demo-app:/var/www/discourse# rails c
[1] pry(main)> Rails.env.production?
=> true
[2] pry(main)> Category.connection
=> [snip]
[3] pry(main)> c = Category.find_by(name: 'Your Category Name')

```

Then you **should** be able to call `#destroy` from there, but really, don’t do it without further confirmation from a team member because there might be other things to do in order to properly delete the category.

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 12:37오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/10 "2018-09-11T12:37:27Z")

</div>

> [@hellekin](#):
>
> you need to check with a team member

I’m the owner of this forum. How should I do it properly?

---

<div class="post-metadata">

### Author: ![hellekin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hellekin/32/51636_2.png) [@hellekin](https://meta.discourse.org/u/hellekin)
#### Post date: [9월 11, 2018, 12:44오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/11 "2018-09-11T12:44:02Z")

</div>

I meant: a Discourse team member, who is more knowledgeable than me on this topic.

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 2:01오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/12 "2018-09-11T14:01:58Z")

</div>

Oh, okay. The problem is here’s no anyone from team. Just no answer or smth like that ☹

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [9월 11, 2018, 2:10오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/13 "2018-09-11T14:10:54Z")

</div>

Deleting the category from the rails console could have bad side effects, it would be better to delete the remaining topic from the user interface. The “About this category” topic cannot be deleted, and does not count towards the “topic count is 1” message. There must be another topic in the category.

When you click “delete category”, you should see a message like this with a link to the remaining topic:

 ![18](https://global.discourse-cdn.com/meta/original/3X/6/8/68cf9c53cebe358df6a06d84cfc00085da775d35.png)

Do you see that?

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 2:12오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/14 "2018-09-11T14:12:31Z")

</div>

Yeah, that’s what I see:

![obraz](https://global.discourse-cdn.com/meta/original/3X/a/b/ab415fb863863effa2bb9f5265940d48d33e5958.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [9월 11, 2018, 2:13오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/15 "2018-09-11T14:13:04Z")

</div>

That message doesn’t look the same as the one I put a screenshot of…

What version of Discourse are you using?

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 2:13오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/16 "2018-09-11T14:13:49Z")

</div>

![obraz](https://global.discourse-cdn.com/meta/original/3X/2/2/224620048be4eb8cfa835193f3062ce8376c21cf.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [9월 11, 2018, 2:15오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/17 "2018-09-11T14:15:15Z")

</div>

Can you list what steps you take to get that “Can’t delete this category” message? And include a screenshot of the whole page showing that message?

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 2:19오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/18 "2018-09-11T14:19:17Z")

</div>

- Archiving the topic
- Deletion of all posts in the topic (action = post)
- Moving topic to another topic
- Deletion of the first post of a topic in the rails console (category description still indicates old content, but this isn’t visible in the topic)
- Update forum/rebuild of app

 ![obraz](https://global.discourse-cdn.com/meta/original/3X/7/2/7256f768218a93a004f218982aa2d841b8f3b77a.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [9월 11, 2018, 2:24오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/19 "2018-09-11T14:24:16Z")

</div>

> [@Sevosik](#):
>
> Deletion of the first post of a topic in the rake console

Ok, I suspect this is what has caused the issue. Generally changing stuff in the rails console is a bad idea, as it can cause unexpected problems like this. Let’s see if we can recover the issue though.

Try going to `/sidekiq/scheduled`, find `Jobs::CategoryStats`, and “Trigger” it. Refresh your page and try deleting the category again. Does that help?

---

<div class="post-metadata">

### Author: ![Sevosik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sevosik/32/80703_2.png) [@Sevosik](https://meta.discourse.org/u/Sevosik)
#### Post date: [9월 11, 2018, 2:27오후 UTC](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737/20 "2018-09-11T14:27:26Z")

</div>

I was actually doing this deletion in the console to solve this problem.. But I tried your hint anyway, and it didn’t help 😕

[다음 페이지](https://meta.discourse.org/t/i-cant-delete-a-category-or-topic-description/96737.md?page=2)
