# Discourse Watch Category Button

**URL:** https://meta.discourse.org/t/discourse-watch-category-button/394656
**Category:** Theme component
**Created:** [January 29, 2026, 1:51pm UTC](https://meta.discourse.org/t/discourse-watch-category-button/394656 "2026-01-29T13:51:49Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![pacharanero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pacharanero/32/500583_2.png) [@pacharanero](https://meta.discourse.org/u/pacharanero)
#### Post date: [January 29, 2026, 1:51pm UTC](https://meta.discourse.org/t/discourse-watch-category-button/394656/1 "2026-01-29T13:51:49Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Watch Category Button** adds a marker span that becomes a “Watch this category” button in posts. |
| 🛠 | **Repository** | [https://github.com/pacharanero/discourse-watch-category-button](https://github.com/pacharanero/discourse-watch-category-button) |
| 📖 | **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

> ℹ This theme component uses the logged‑in user’s session to update category notification levels; no API keys are required.

## Features

- Add a “Watch this category” button inside posts using a sanitizer‑safe span.

- Clicking the button sets the **current user’s** category notification level to **Watching** for either the current category or one selected by CategoryId.

- Only posts authored by allowed groups (default: `staff`) are transformed into buttons (this is to reduce the chance of this TC being misused to make people watch categories by misrepresentation).

- Supports targeting a specific category ID or the current post’s category.

- Hooks into existing Discourse Watching notifications functionality, doesn’t change how Watching status is otherwise managed by a user in their preferences, per-Category, or in email notification Unsubscribes.

## Usage

**Set a specific category**

```plaintext
<span data-watch-category="3">Watch this category</span>

```

**Use the current post’s category**

```plaintext
<span data-watch-category="current">Watch this category</span>

```

Result:

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/1/c/41c9c6f46e9f900d426916b80ff0273c92c7484b.png)

## Settings

This component does not include theme settings yet. That’s next, once I have made sure there are no major bugs and that this TC is of some use to other people.

## Security and privacy considerations

- These buttons can only be created by #staff users (at the moment)
- Requires an explicit user click to change notification settings.
- No API keys are used; it relies on the logged-in session.

## Roadmap ideas

- Make the groups who can create buttons configurable via theme settings.
- Make the button style configurable via theme settings.
- Make the Notification Level configurable (e.g., Tracking, Watching, Muted).

## Contributing

I’m happy to accept contributions! Please open issues or pull requests on the GitHub repository. Ideally let’s improve _this_ component rather than forking it to change the ALLOWED\_GROUPS or other minor changes.

## Related topics

In researching whether this TC had already been made, I found a few topics requesting similar functionality:

[Change notification level with a link](https://meta.discourse.org/t/change-notification-level-with-a-link/57784)  
[Can I create a link to subscribe to a category? - #3 by david](https://meta.discourse.org/t/can-i-create-a-link-to-subscribe-to-a-category/102964/3)  
[Make watching a category more prominent for users](https://meta.discourse.org/t/make-watching-a-category-more-prominent-for-users/205956)  
[Notification setting button with context](https://meta.discourse.org/t/notification-setting-button-with-context/59383)

---

_[View the full topic](https://meta.discourse.org/t/discourse-watch-category-button/394656)._
