# 如何阻止某人刷屏“热门搜索词”？

**URL:** <https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706>\
**Category:** Support\
**Created:** [2019年三月5日 08:03 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706 "2019-03-05T08:03:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![snakeninny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/snakeninny/32/115522_2.png) [@snakeninny](https://meta.discourse.org/u/snakeninny)\
**Post date:** [2019年三月5日 08:03 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/1 "2019-03-05T08:03:01Z")

</div>

I don’t know why they’re doing this and what do they want. Any ideas? Thanks!

 ![17](https://global.discourse-cdn.com/meta/original/3X/0/4/0488a56a2c5f7de7968765b0f9781639ced0e6b7.png)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年三月5日 17:27 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/3 "2019-03-05T17:27:48Z")

</div>

Have you seen this @sam? Odd.

---

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [2019年三月5日 17:36 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/4 "2019-03-05T17:36:59Z")

</div>

This happens in Google Analytics all the time — the hope is that the searches are published somewhere or an admin visits the link.

> **[Referrer spam](https://en.wikipedia.org/wiki/Referrer_spam)**
>
> Referrer spam (also known as referral spam, log spam or referrer bombing) is a kind of spamdexing (spamming aimed at search engines). The technique involves making repeated web site requests using a fake referrer URL to the site the spammer wishes to advertise. Sites that publish their access logs, including referrer statistics, will then inadvertently link back to the spammer's site. These links will be indexed by search engines as they crawl the access logs, improving the spammer's search en At...

I wonder if the same user is spamming these? Could we possibly look for a user who is searching for a url hundreds of times and flag their account?

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2019年三月5日 20:28 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/5 "2019-03-05T20:28:07Z")

</div>

For a lot of communities it’s uncommon for users to search URLs at all, so it probably doesn’t even need to be hundreds.

---

<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:** [2019年三月5日 20:40 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/6 "2019-03-05T20:40:18Z")

</div>

It sure is a very frustrating abuse factor, maybe we should auto eliminate spammers from the list, same IP or user, a gazzilion searches

I really would like to see the raw data here

Have not seen this before on our sites

---

<div class="post-metadata">

**Author:** ![snakeninny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/snakeninny/32/115522_2.png) [@snakeninny](https://meta.discourse.org/u/snakeninny)\
**Post date:** [2019年三月6日 10:02 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/7 "2019-03-06T10:02:45Z")

</div>

I can send you the raw data for sure; which file is it?

---

<div class="post-metadata">

**Author:** ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)\
**Post date:** [2020年三月22日 20:15 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/8 "2020-03-22T20:15:53Z")

</div>

我最近也看到了这个问题——有什么我可以做的来发送数据或请人查看吗？这个帖子似乎已经沉寂了。谢谢！

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年三月22日 22:02 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/9 "2020-03-22T22:02:02Z")

</div>

您具体在哪里看到的？能分享一张截图吗？

---

<div class="post-metadata">

**Author:** ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)\
**Post date:** [2020年三月22日 22:59 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/10 "2020-03-22T22:59:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2020年三月22日 23:08 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/11 "2020-03-22T23:08:05Z")

</div>

一个简单的修复方案，是否可以直接阻止匿名用户搜索任何符合域名正则表达式的字符串？

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年三月22日 23:12 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/12 "2020-03-22T23:12:32Z")

</div>

看起来你似乎可以通过简单地禁止所有 `.cn` 域名的搜索来获胜，但实际影响非常小（而且他们所做的毫无意义且效率极低），因此很难证明投入任何工程努力是合理的。

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2020年七月17日 21:03 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/13 "2020-07-17T21:03:20Z")

</div>

我们的网站也遇到了类似但略有不同的情况。

我们似乎有某种机器人每天在我们的论坛上搜索几个关键词。

有没有办法屏蔽特定的搜索词？

或者，能否将搜索词与 IP 地址关联，进而屏蔽该 IP？

例如，这些情况严重影响了我们的搜索词数据分析：

 ![Screen Shot 2020-07-17 at 21.59.44](https://global.discourse-cdn.com/meta/original/3X/b/0/b056ce64e43c3e67de10b900ed44e3a23e1fc64c.png)

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2020年七月17日 21:52 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/14 "2020-07-17T21:52:13Z")

</div>

Capybara 是 discobot 的一部分。你能看到它，说明 discobot 正在正常工作，并且用户正在顺利完成新用户教程。

其他的我不认识。

说实话，我不确定在这个列表中出现一些随机关键词有什么问题。确实有点奇怪，但只有你能看到它。

或许增加一个修剪此列表的功能会很有趣。例如，不再向我显示有多少人在我的网站上搜索过“水豚”。不过，我认为这优先级不高。

---

<div class="post-metadata">

**Author:** ![rux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rux/32/209612_2.png) [@rux](https://meta.discourse.org/u/rux)\
**Post date:** [2021年三月2日 11:16 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/15 "2021-03-02T11:16:53Z")

</div>

抱歉把旧话题顶起来了，我也遇到了大量类似的垃圾信息。  
该如何屏蔽所有针对 `.cn` 域名的搜索呢？

我已经在屏蔽词列表中添加了过滤规则，但搜索结果仍然会出现：

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

不太清楚这些搜索的目的，但在搜索日志中看到这么多垃圾信息实在令人烦躁 😕

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

---

<div class="post-metadata">

**Author:** ![chrispanag](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrispanag/32/105853_2.png) [@chrispanag](https://meta.discourse.org/u/chrispanag)\
**Post date:** [2021年三月9日 20:44 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/16 "2021-03-09T20:44:42Z")

</div>

这周我们网站上也开始出现这种情况了！目前来看，影响微乎其微……

 ![Screenshot 2021-03-09 at 21.43.08](https://global.discourse-cdn.com/meta/original/3X/8/5/8584016159ba1127d8463eb3a1c4f3d271d0fe01.png)

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2022年七月7日 19:29 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/17 "2022-07-07T19:29:44Z")

</div>

我们的搜索结果中仍然充斥着各种无用的内容。

 ![Screen Shot 2022-07-07 at 20.25.02](https://global.discourse-cdn.com/meta/original/4X/9/3/f/93f06015c3ab20f3f38a911cf6f6d172516f2031.png)

我猜它某种程度上是（搜索）机器人，因为它都在一天内涌入，然后消失一个月。

 ![Screen Shot 2022-07-07 at 20.26.07](https://global.discourse-cdn.com/meta/original/4X/a/3/6/a3627c906868346773342bd63d94110a42faa56c.png)

我尝试将一些关键词添加到我们的屏蔽词列表中，但这似乎并不能阻止人们搜索这些关键词，它只阻止他们发布这些词。

我确定我以前问过这个问题，我们能否关闭未登录用户的搜索功能？

或者任何人有什么建议来解决或规避这个问题？当搜索日志充满了机器人/垃圾信息时，它们毫无意义 😕

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2022年十一月25日 20:31 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/18 "2022-11-25T20:31:16Z")

</div>

> [@Richie](#):
>
> 有办法阻止特定的搜索词吗？

因为最初：

> [@Richie](#):
>
> 我们仍然在搜索结果中看到各种无用的东西。

但现在我们的搜索日志简直毫无用处。

看看这个：

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/c/6/7c644d1f6604cdcce79725af22f3321263188fbe.jpeg)

整个月只有一次有效的搜索。

这太没用了 😕

我真心欢迎任何关于如何解决此问题或如何阻止未登录用户进行搜索的建议。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2022年十一月25日 21:03 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/19 "2022-11-25T21:03:48Z")

</div>

> [@Richie](#):
>
> 如何阻止未登录用户执行搜索。

有一个名为 `rate_limit_search_anon_global` 的隐藏站点设置可用于限制此操作。

---

<div class="post-metadata">

**Author:** ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)\
**Post date:** [2022年十一月26日 11:23 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/20 "2022-11-26T11:23:57Z")

</div>

谢谢 @Falco

它期望的是布尔值还是整数值？

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2022年十一月26日 11:46 UTC](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706/21 "2022-11-26T11:46:26Z")

</div>

详细信息在 `site_settings.yml` 中，它期望一个整数值：

> <https://github.com/discourse/discourse/blob/274b21663e8283d0053b29ffabf3afa8042ee3cd/config/site_settings.yml#L1892>

[下一頁](https://meta.discourse.org/t/how-do-i-stop-someone-from-spamming-trending-search-terms/110706.md?page=2)
