# Hide ignored users' topics

**URL:** <https://meta.discourse.org/t/hide-ignored-users-topics/276420>\
**Category:** Theme component\
**Created:** [August 24, 2023, 9:57am UTC](https://meta.discourse.org/t/hide-ignored-users-topics/276420 "2023-08-24T09:57:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Lhc\_fl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lhc_fl/32/268115_2.png) [@Lhc\_fl](https://meta.discourse.org/u/Lhc_fl)\
**Post date:** [August 24, 2023, 9:57am UTC](https://meta.discourse.org/t/hide-ignored-users-topics/276420/1 "2023-08-24T09:57:46Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | This component allows you to hide topics from users you’ve ignored |
| 🛠 | **Repository** | [GitHub - Lhcfl/discourse-hide-ignored-user-topics · GitHub](https://github.com/Lhcfl/discourse-hide-ignored-user-topics) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

Take inspiration from this post:

> [@Possible to mute all topics from specified IDs?](https://meta.discourse.org/t/possible-to-mute-all-topics-from-specified-ids/276321/3):
>
> but my question is how to hide the **topic** from the topic list page for a given ID.  
> say on this list page: [support - Discourse Meta](https://meta.discourse.org/c/support/6)  
> how to totally hide the topics/discussion thread started by a given ID.
> 
> some users on our site, they want to be able to do that…  
> very likely, it is not supported yet. but seems there is some use case/need for this…  
> thanks…

This component allows you to hide topics from users you’ve ignored.

It does exactly what it sounds like, and its main principle is very simple, so I will paste the main code below:

```js
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("1.8.0", (api) => {
  const user = api.getCurrentUser();
  if (user == null) return;
  api.registerValueTransformer(
    "topic-list-item-class",
    ({ value, context }) => {
      if (user.ignored_users.includes(context.topic.creator.username)) {
        value.push("hidden");
      }
      return value;
    }
  );
});

```

---

_[View the full topic](https://meta.discourse.org/t/hide-ignored-users-topics/276420)._
