# Muted categories showing for anonymous users

**URL:** https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122
**Category:** Bug
**Created:** [August 30, 2021, 2:32pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122 "2021-08-30T14:32:12Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 30, 2021, 2:32pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/1 "2021-08-30T14:32:12Z")

</div>

I have a site with a bunch of muted categories. These categories and topics are hidden when visiting as a logged-in user, but anonymous users see these categories (on `/categories`) and topics from those appear in `/latest`.

EDIT: FWIW:

```
      <meta name="generator" content="Discourse 2.8.0.beta4 - https://github.com/discourse/discourse version b673fee9464e823de3c3423a5f8c45732896b429">

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 31, 2021, 5:39am UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/2 "2021-08-31T05:39:02Z")

</div>

@vinothkannans I vaguely recall we dealt with this issue in the past, do you remember?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [August 31, 2021, 6:07am UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/3 "2021-08-31T06:07:55Z")

</div>

Yes, we pushed a fix for that. I will check the issue again.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 4, 2021, 5:06pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/4 "2021-09-04T17:06:31Z")

</div>

Just checking on this. I upgraded to the current beta6 and the problem persists.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [September 5, 2021, 1:05pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/5 "2021-09-05T13:05:02Z")

</div>

@pfaffman I’m unable to reproduce this issue both in my development environment and personal site. It is working properly for me.

> [@pfaffman](#):
>
> anonymous users see these categories (on `/categories` )

On `/categories` page, if a muted category has subcategories which are not muted then it will appear to display the list of sub-categories.

> [@sam](#):
>
> we dealt with this issue in the past

here is the old fix

[https://github.com/discourse/discourse/commit/57bbcf4c5db4a99d2e01324ee2f172b741fcc5f9](https://github.com/discourse/discourse/commit/57bbcf4c5db4a99d2e01324ee2f172b741fcc5f9)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 7, 2021, 3:09pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/6 "2021-09-07T15:09:43Z")

</div>

Thanks for checking. I’m pretty stumped, then.

My best guess is that it’s something with the question/answer plugin, thoug disabling it didn’t change anything. I don’t see how a theme component could change that.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 15, 2021, 4:58pm UTC](https://meta.discourse.org/t/muted-categories-showing-for-anonymous-users/202122/7 "2021-09-15T16:58:01Z")

</div>

So here’s the issue.

If `mute_all_categories_by_default` is set, then it ignores the muted categories list. It’s giving me all categories if `mute_all_categories_by_default`, but obeys the `default_categories_muted` if it’s not.

> <https://github.com/discourse/discourse/blob/main/lib/topic_query.rb#L836>

This seems like a bug, to ignore the muted categories, or maybe it doesn’t make any sense to have muted categories if all categories are muted by default. But it would seem like if all categories are muted by default and there are no watched categories then it should show nothing?
