# Proper way to set digest and hide category from latest

**URL:** https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888
**Category:** Support
**Tags:** activity-summary
**Created:** [September 30, 2021, 4:47pm UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888 "2021-09-30T16:47:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [September 30, 2021, 4:47pm UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/1 "2021-09-30T16:47:54Z")

</div>

Hi,

as an admin of the forum, I want all users will be subscribed to certain categories with the mail list option enabled.

I tried to set categories in my profile (watched, tracked and muted) so that to find these settings in the database. I would like to apply the same settings to other users, seems it is `category_users`

 ![изображение](https://global.discourse-cdn.com/meta/original/3X/b/a/ba156a61946be80aab0ef681c5021bcb3f2dee8d.png)

Am I right, that I can make some inserts to achive this?

Previously I tried to set some categories as ‘mail listed’ to be sure that digest would contain only those categories, but I wasn’t right - this setting doesn’t tune the digest contents.

Maybe the logic is different? The aim is:

- to force new users to receive a digest from certain categories (okay, let them to modify by themselves later)
- do not show some categories in their ‘latest’ page

I found a topic [Viewing a list of users who are watching a category](https://meta.discourse.org/t/viewing-a-list-of-users-who-are-watching-a-category/15225) near to my case. But I was not sure to bump it after 5 years.

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [September 30, 2021, 5:04pm UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/2 "2021-09-30T17:04:08Z")

</div>

why dont you use these settings

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/3/f39e38bfd90db2b4f088a132cbb753b5291df986.png)

---

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [September 30, 2021, 5:06pm UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/3 "2021-09-30T17:06:52Z")

</div>

I’m not sure this can help. I’m looking for a batch way to set this for 100 other users.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [September 30, 2021, 5:21pm UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/4 "2021-09-30T17:21:25Z")

</div>

If you select it, a box pops up asking if you want to change it for everyone, or just going forward. 👍

---

<div class="post-metadata">

### Author: ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)
#### Post date: [October 4, 2021, 11:44am UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/5 "2021-10-04T11:44:01Z")

</div>

I’d like to share my solution.

I clicked necessary settings in UI (mute and track some categories) as Gavin mentioned:

> [@IAmGav](#):
>
> these settings

Then I connected to the DB to determine id’s of categories and users. Tables: `category_users` and `users`.

I filtered settings for myself (for user\_id=5) as shown in the picture below:

 ![изображение](https://global.discourse-cdn.com/meta/original/3X/b/a/ba156a61946be80aab0ef681c5021bcb3f2dee8d.png)

Next, I want to apply the same settings for two other users with id=33 and 34. Obviously I need to add proper lines into the table `category_users`.

Example:

- There are 6 categories: id=1, 2, 15, 17, 19 and 24.
- Muted categories 15 and 17
- Watching the first post in categories 1, 2 and 24
- Tracking one category 19.

First of all I created a script that insertes all of the selected categories to muted section (notification\_level=0):

```sql
INSERT INTO 
	"category_users" 
	("category_id", "user_id", "notification_level", "last_seen_at") 
VALUES
(24, 34, 0, NULL),
(2, 34, 0, NULL),
(1, 34, 0, NULL),
(19, 34, 0, NULL),
(15, 34, 0, NULL),
(17, 34, 0, NULL),

(24, 33, 0, NULL),
(2, 33, 0, NULL),
(1, 33, 0, NULL),
(19, 33, 0, NULL),
(15, 33, 0, NULL),
(17, 33, 0, NULL);

```

You may add up to 1000 lines at once.

After that I updated the raws for Tracked and Watched 1st post categories:

```sql
--watch 1st post
UPDATE "public"."category_users" SET "notification_level"='4' WHERE "category_id" in (1,2,24);
--track
UPDATE "public"."category_users" SET "notification_level"='2' WHERE "category_id"=19;

```

After that user settings are updated. Muted categories are hidden from main page and latest topics.

![изображение](https://global.discourse-cdn.com/meta/original/3X/3/a/3a2a2d7f2934d94810e13cb2bd977b54448df497.png)

Let me know if there is any other simple way to bulk edit users settings concerning muted or watched categories.

---

<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: [November 3, 2021, 11:44am UTC](https://meta.discourse.org/t/proper-way-to-set-digest-and-hide-category-from-latest/204888/6 "2021-11-03T11:44:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
