# How to select a lot of topics fast?

**URL:** https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790
**Category:** Support
**Created:** [2월 27, 2015, 8:10오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790 "2015-02-27T20:10:12Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![ccdw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ccdw/32/51564_2.png) [@ccdw](https://meta.discourse.org/u/ccdw)
#### Post date: [1월 23, 2016, 11:27오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/21 "2016-01-23T23:27:20Z")

</div>

> [@sam](#):
>
> You need to stop using jQuery ready instead you should use Ember router.
> 
> @eviltrout this keeps popping up, can we introduce Discourse.PageReady(function(){}) as a drop-in replacement for jQuery ready ?

Can somebody please tell me which Discourse client side event I should be using to tell when the page has finished updating?

I seem to remember there is also an event that fires when the page changes? That would be helpful too.

Thank you.

---

<div class="post-metadata">

### Author: ![Bill\_S](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Bill\_S](https://meta.discourse.org/u/Bill_S)
#### Post date: [3월 8, 2016, 5:18오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/22 "2016-03-08T17:18:04Z")

</div>

Is there going to be any alternative for having fast-multi-selection of topics from Discourse. Because the jQuery hack at the top is no longer working for me. Someone brought up doing a “search all” for the forum. How does that work?

---

<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: [3월 8, 2016, 10:55오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/23 "2016-03-08T22:55:28Z")

</div>

Sure maybe @techapj can come up with a hack that works on the current version?

---

<div class="post-metadata">

### Author: ![Bill\_S](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Bill\_S](https://meta.discourse.org/u/Bill_S)
#### Post date: [3월 8, 2016, 11:29오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/24 "2016-03-08T23:29:20Z")

</div>

Thanks @codinghorror for responding.

This is the thing, I have boards that I’m going to eventually need to remove that have over 6-7,000 topics (that translates to over 30,000 posts in some). Removing topics at the rate of 50 at a time - cause I finally figured out how to search all topics for a forum - isn’t going to cut it for those of us at an enterprise level. Just cleaning up staging has taken me most of the day to do the simplest things of re-ording and dumping old boards that I don’t need there.

Should I post, as an idea, creating a method to remove all posts at once from a forum, in order to delete that category, so we can see how many would like that? Or, a means of deleting a category, posts and all, all at once?

Unfortunately, as you gain more enterprise users of Discourse, you are going to run into this as an issue over and over again. I can guarantee it. 🕶

---

<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: [3월 8, 2016, 11:37오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/25 "2016-03-08T23:37:10Z")

</div>

Regardless, it’s going to be mega-slow as doing this triggers probably a hundred database touching code paths. So if you are “recategorizing” 30k topics an entirely different (probably pure sql, bypassing active record) will be necessary.

---

<div class="post-metadata">

### Author: ![Bill\_S](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Bill\_S](https://meta.discourse.org/u/Bill_S)
#### Post date: [3월 9, 2016, 12:06오전 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/26 "2016-03-09T00:06:10Z")

</div>

Would it be more than the 30 or 40 minutes it will take to manually delete 6,000 topics? 😅

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [3월 9, 2016, 1:23오전 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/27 "2016-03-09T01:23:08Z")

</div>

> [@codinghorror](#):
>
> probably pure sql

> [@Bill\_S](#):
>
> more enterprise users of Discourse

When using on Enterprise you gotta get your hands dirty sometimes.

I have a need to sync groups with employee groups, with more than 10k users a day. We just drop to database and update users groups accordingly.

---

<div class="post-metadata">

### Author: ![Bill\_S](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Bill\_S](https://meta.discourse.org/u/Bill_S)
#### Post date: [3월 9, 2016, 6:25오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/28 "2016-03-09T18:25:10Z")

</div>

😣 I guess I’ll get there…

---

<div class="post-metadata">

### Author: ![ezworldwide](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ezworldwide/32/49134_2.png) [@ezworldwide](https://meta.discourse.org/u/ezworldwide)
#### Post date: [3월 16, 2016, 8:50오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/29 "2016-03-16T20:50:22Z")

</div>

I was finally able to migrate one of my Xenforo forums into Discourse. The migration dumped everything in Uncategorized as there were no categories established on a fresh install of Discourse. I’m glad I was able to get the script to work, but now I have all posts from 2011 to present in Uncategorized. My intent was to select all and place into the “Archive” category. Perhaps I should have read more about the need to manually click each topic to execute bulk actions. It seems a bit weird to not have a “select all” feature to mass move topics.

---

<div class="post-metadata">

### Author: ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)
#### Post date: [6월 11, 2016, 6:06오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/30 "2016-06-11T18:06:31Z")

</div>

I recently went through the process of moving topics from inactive categories to other locations. I used a tool called Keyboard Maestro to simulate pressing space/tab 1000 times to effectively select all topics in a category. A bit of a hack, but got the job done.

Note this solution might work for a few hundred topics. Not sure about thousands.

---

<div class="post-metadata">

### Author: ![ossia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ossia/32/215651_2.png) [@ossia](https://meta.discourse.org/u/ossia)
#### Post date: [11월 11, 2016, 7:14오전 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/31 "2016-11-11T07:14:44Z")

</div>

This code was not working for me:

```plaintext
$('input[type="checkbox"]').attr('checked', 'checked')

```

It was checking the boxes, but the wrench button wouldn’t pop up (I don’t think Discourse was registering them as having been selected).

So instead, I simulated a click with:

```plaintext
$('input[type="checkbox"]').each(function() { this.click()})

```

and this worked as though I’d manually clicked the checkboxes myself. This seems to be the simplest way to do this for one-time migrations. I hope this proves helpful 🙂

---

<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: [11월 11, 2016, 8:53오전 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/32 "2016-11-11T08:53:13Z")

</div>

This is still on @techapj’s list, at least for selecting all topics currently visible.

---

<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: [11월 18, 2016, 5:06오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/33 "2016-11-18T17:06:10Z")

</div>

> [@codinghorror](#):
>
> selecting all topics currently visible.

This feature is now available via:

[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: [11월 18, 2016, 9:40오후 UTC](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790/34 "2016-11-18T21:40:24Z")

</div>



[이전 페이지](https://meta.discourse.org/t/how-to-select-a-lot-of-topics-fast/25790.md?page=1)
