# Using topic.destroy(id) to delete illegal content

**URL:** <https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239>\
**Category:** Development\
**Created:** [March 30, 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:** 2

<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:** [March 30, 2018, 6:17pm UTC](https://meta.discourse.org/t/using-topic-destroy-id-to-delete-illegal-content/84239/2 "2018-03-30T18:17:49Z")

</div>

What other tables cross index the topic id?  
Did you delete those rows as well?  
What other tables cross index fields in those other tables?  
Did you delete those rows?  
rinse - repeat - until all are deleted.

IMHO it is much safer and a lot simpler to “delete” a topic using the UI than to delete it from the database.

AFAIK there is no “on delete cascade” code in Core and deleting fields from tables is not a supported practice, and hence not a Bug.

---

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