# Exclude\_tag 在分类 RSS 源中不起作用

**URL:** https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034
**Category:** Bug
**Tags:** rss-polling
**Created:** [2026年四月6日 16:17 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034 "2026-04-06T16:17:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![f-a](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@f-a](https://meta.discourse.org/u/f-a)
#### Post date: [2026年四月6日 16:17 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034/1 "2026-04-06T16:17:13Z")

</div>

`exclude_tag` 在_分类_ RSS 源中不起作用（特别是针对这些源）。

**复现步骤：**

```plaintext
wget -O a.xml “https://meta.discourse.org/c/support/6.rss”
wget -O b.xml “https://meta.discourse.org/c/support/6.rss?exclude_tag=ai”
diff a.xml b.xml

```

您会看到这两个文件是相同的。

**预期结果：**

带有 `ai` 标签的内容应从 RSS 源中排除。

**附加信息：**

_主_ RSS 源可以正常工作，即：

```plaintext
wget -O a-all.xml “https://meta.discourse.org/latest.rss”
wget -O b-all.xml “https://meta.discourse.org/latest.rss?exclude_tag=ai”
diff a-all.xml b-all.xml

```

显示这两个文件是不同的。

---

<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: [2026年四月7日 04:59 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034/2 "2026-04-07T04:59:55Z")

</div>

我有一个简单的变通方案！

`/latest.rss?category=6&exclude_tag=ai`

已确认类别 RSS 订阅源中的边缘情况。

像这样应该能彻底解决问题。稍后我会标记协作。

```plaintext
def category_feed
  guardian.ensure_can_see!(@category)
  discourse_expires_in 1.minute
  # ...
  @topic_list = TopicQuery.new(current_user, build_topic_list_options)
                           .list_new_in_category(@category)
  render "list", formats: [:rss]
end

```

---

<div class="post-metadata">

### Author: ![f-a](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@f-a](https://meta.discourse.org/u/f-a)
#### Post date: [2026年四月7日 05:54 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034/3 "2026-04-07T05:54:42Z")

</div>

我可以确认这个简单的变通方法：  
a) 很容易；  
b) 确实有效。

非常感谢！

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年四月7日 12:48 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034/5 "2026-04-07T12:48:43Z")

</div>

@f-a 感谢你的报告 👍 这将在以下链接中修复：

> <https://github.com/discourse/discourse/pull/39130>
>
> Most RSS feed endpoints (category, top, hot, user topics, top period) were const…ructing \`TopicQuery\` without passing \`build\_topic\_list\_options\`, so query params like \`exclude\_tag\`, \`tags\`, \`status\`, etc. were silently ignored. Only \`latest\_feed\` correctly passed them through.
> 
> Extracts a \`topic\_query\` helper that always merges \`build\_topic\_list\_options\`, and updates all feed methods to use it. This makes it harder to forget query params when adding new feeds.
> 
> https://meta.discourse.org/t/400034

---

<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: [2026年四月12日 22:00 UTC](https://meta.discourse.org/t/exclude-tag-does-not-work-in-category-rss-feeds/400034/7 "2026-04-12T22:00:16Z")

</div>

此主题已在 4 天后自动关闭，不再接受新回复。
