# How do I count topics in sub-categories?

**URL:** https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085
**Category:** Support
**Created:** [4 במאי,‏ 2017,‏ 2:08am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085 "2017-05-04T02:08:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![OpusK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/opusk/32/81174_2.png) [@OpusK](https://meta.discourse.org/u/OpusK)
#### Post date: [4 במאי,‏ 2017,‏ 2:08am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/1 "2017-05-04T02:08:38Z")

</div>

I do not need to display it to anyone. I just want to see how many topics are in my sub-categories by Admin.

While it’s easy to see the top-categories, we’re not looking for those features in sub-categories.

Are these features basically missing?  
If it is not, I would appreciate it if anyone let me know how it works 🙂

---

<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: [4 במאי,‏ 2017,‏ 2:17am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/2 "2017-05-04T02:17:28Z")

</div>

The quickest way is likely to open the sub-category edit page and try to click delete. It will fail as there are topics, but the message will give you the number of topics. Alternatively, you could write a simple [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query.

---

<div class="post-metadata">

### Author: ![OpusK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/opusk/32/81174_2.png) [@OpusK](https://meta.discourse.org/u/OpusK)
#### Post date: [4 במאי,‏ 2017,‏ 2:28am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/3 "2017-05-04T02:28:04Z")

</div>

Oh, that’s a very simple way!  
However, I can not see it at a glance in Admin Page .. ☹

Anyway, it seems to be good to use as it is urgent.  
Your answers are a big help because I am in a hurry right now. 🙂

---

<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: [4 במאי,‏ 2017,‏ 2:56am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/4 "2017-05-04T02:56:00Z")

</div>

Here are some quick [Data Explorer](https://meta.discourse.org/t/32566?silent=true) queries in case you need to do this more in the future.

Query to get topic count for one category (or subcategory).

```plaintext
-- [params]
-- null string_list :category_name
SELECT topic_count FROM categories
WHERE categories.name = :category_name

```

Query to list all categories (and subcategories) and their topic counts:

```plaintext
SELECT name, topic_count FROM categories

```

---

<div class="post-metadata">

### Author: ![OpusK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/opusk/32/81174_2.png) [@OpusK](https://meta.discourse.org/u/OpusK)
#### Post date: [4 במאי,‏ 2017,‏ 3:01am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/5 "2017-05-04T03:01:33Z")

</div>

Wow!  
It will help me a lot in the future.

Thank you for your kind reply 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1 ביוני,‏ 2019,‏ 11:29am UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/6 "2019-06-01T11:29:49Z")

</div>



---

<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: [1 ביוני,‏ 2019,‏ 9:56pm UTC](https://meta.discourse.org/t/how-do-i-count-topics-in-sub-categories/62085/7 "2019-06-01T21:56:57Z")

</div>


