# Usare topic.destroy(id) per eliminare contenuti illegali

**URL:** <https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239>\
**Category:** Development\
**Created:** [30 Marzo 2018, 5:00pm UTC](https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239 "2018-03-30T17:00:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![vikaskedia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikaskedia/32/73333_2.png) [@vikaskedia](https://meta.discourse.org/u/vikaskedia)\
**Post date:** [30 Marzo 2018, 5:00pm UTC](https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239/1 "2018-03-30T17:00:58Z")

</div>

My goal was to delete a topic from the DB due to legal reasons.

so I ran the command:

> root@he-ps09-superstars:/var/www/discourse# echo “Topic.destroy(id)” | rails c

The topic was deleted 👍

The category still thinks there is 1 topic and I cannot delete the category.

---

_[View the full topic](https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239)._
