# Batch Delete topics in a category?

**URL:** https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128
**Category:** Feature
**Tags:** bulk-actions
**Created:** [January 22, 2014, 7:27pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128 "2014-01-22T19:27:19Z")
**Posts on this page:** 9
**Page:** 3

<div class="post-metadata">

### Author: ![jamesmarkcook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesmarkcook/32/168563_2.png) [@jamesmarkcook](https://meta.discourse.org/u/jamesmarkcook)
#### Post date: [July 25, 2016, 5:17pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/41 "2016-07-25T17:17:58Z")

</div>

Might be quicker to use rails console for this until there is GUI support. Would there be any consequence of running?:

```
Topic.where(category_id: 1).destroy_all

```

I assume this will clean up after itself? @zogstrip @sam

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 25, 2016, 7:12pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/42 "2016-07-25T19:12:02Z")

</div>

It may take hours or even days to run if the number of topics is large.

---

<div class="post-metadata">

### Author: ![FTL\_Ian](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ftl_ian/32/63642_2.png) [@FTL\_Ian](https://meta.discourse.org/u/FTL_Ian)
#### Post date: [November 6, 2016, 9:34pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/43 "2016-11-06T21:34:48Z")

</div>

I’m really liking discourse so far, but this seems like a basic admin feature that has been overlooked. Another, clunky way to do this is to create some kind of macro that will select, scroll down, select, and so on.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 6, 2016, 9:51pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/44 "2016-11-06T21:51:23Z")

</div>

I believe adding basic “select all visible topics” is on @techapj’s plate for this release.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 6, 2016, 9:53pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/45 "2016-11-06T21:53:12Z")

</div>

Jeff, can you define “visible”? Is this only what can be seen on screen, or what is loaded at the moment?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 6, 2016, 9:54pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/46 "2016-11-06T21:54:44Z")

</div>

Only what is on screen. Otherwise it is a very hard feature to build and it could take hours or even days to run if you “selected” six thousand topics.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [November 6, 2016, 9:56pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/47 "2016-11-06T21:56:24Z")

</div>

Makes sense. Still would be nice to have some way to select all topics in a category, even if a background task like exporting a report.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [November 18, 2016, 3:04pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/48 "2016-11-18T15:04:17Z")

</div>

This is now done ☀

[https://github.com/discourse/discourse/commit/9c7b891afdb687e1ceb110ba07e53b805f04bb5d](https://github.com/discourse/discourse/commit/9c7b891afdb687e1ceb110ba07e53b805f04bb5d)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 18, 2016, 9:50pm UTC](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128/49 "2016-11-18T21:50:27Z")

</div>



[Previous page](https://meta.discourse.org/t/batch-delete-topics-in-a-category/12128.md?page=2)
