# 可配置的站点设置，用于为用户发布的链接设置“nofollow”

**URL:** https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004
**Category:** Site Management
**Tags:** seo, reference, content
**Created:** [2018 年7 月 24 日 13:48 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004 "2018-07-24T13:48:48Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [2018 年7 月 24 日 13:48 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/1 "2018-07-24T13:48:48Z")

</div>

> 🔖 本文档介绍如何为 Discourse 论坛中用户发布的链接配置“nofollow”属性。
> 
> 🙋 所需用户等级：管理员

## 默认“nofollow”实现

默认情况下， **所有用户提交的链接** 都会添加 `rel="noopener nofollow ugc"`，以防止不当或潜在有害的行为。`nofollow` 属性告知搜索引擎不要认可该链接，而 `ugc` 则标识其为用户生成内容。这包括用户个人资料上的所有链接，因为 `robots.txt` **会忽略所有个人资料信息** 。

不过，管理员可以管理一些例外情况，以提高某些链接对您网站和受信任用户的关联性。

## 例外情况

- **工作人员帖子** ：由工作人员成员发布的链接不会获得“nofollow”属性。
- **信任等级 3 用户** ：达到信任等级 3 的普通用户，其链接可以被追踪。如有必要，可以禁用此设置。
- **白名单域名** ：管理员可以创建域名白名单（包括子域名），以允许特定受信任站点的链接为“follow”。

## 配置“nofollow”设置

请按照以下步骤通过管理员设置管理“nofollow”设置：

### 步骤 1：配置通用“nofollow”设置

1. 导航至 `管理员 / 站点设置 / 垃圾信息`。
2. 确保默认选中 `为用户内容添加 rel nofollow` 设置。  
 ![垃圾信息设置](https://global.discourse-cdn.com/meta/original/3X/b/a/ba8948a8b3974a794b84301502f6f7e488b8974c.png)
3. 如果您更改此设置（不推荐），则需要重新生成所有帖子，以便将新设置应用于现有链接。

### 步骤 2：配置信任等级 3 设置

1. 导航至 `管理员 / 站点设置 / 信任等级`。
2. 默认情况下，TL3 用户的链接会被追踪。您可以勾选复选框以移除此例外，并将所有用户链接保持为 `rel="nofollow"`。  
 ![信任等级设置](https://global.discourse-cdn.com/meta/original/3X/d/e/de893139eef045135815cf852926ad7a2fcb45d3.png)

### 步骤 3：域名白名单

1. 在 `管理员 / 站点设置` 中搜索 `exclude rel nofollow domains`，或在分析区域中找到该选项。
2. 将您网站的父域名添加到 `exclude rel nofollow domains` 白名单中。  
 ![排除域名设置](https://global.discourse-cdn.com/meta/original/3X/b/d/bdcbfbea09fa1e74584bf0bb3d9b2d5bb21b5cce.png)
3. 这将允许内部链接以及同一网站（Discourse 之外）内容的链接被追踪，从而提高内容的可见性和相关性。

### 白名单提示：

- 在为热门域名上的网站设置白名单时，仅包含特定的子域名。例如，使用 `myblog.wordpress.com`，以避免将所有 `wordpress.com` 子域名都加入白名单。

---

<div class="post-metadata">

### Author: ![Salvino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/salvino/32/117451_2.png) [@Salvino](https://meta.discourse.org/u/Salvino)
#### Post date: [2020 年2 月 28 日 09:30 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/2 "2020-02-28T09:30:05Z")

</div>

如果链接由管理员添加，则不会添加“Nofollow”。

如何为这些链接也添加“Nofollow”？

---

<div class="post-metadata">

### Author: ![tkrunning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tkrunning/32/119481_2.png) [@tkrunning](https://meta.discourse.org/u/tkrunning)
#### Post date: [2020 年2 月 28 日 12:06 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/3 "2020-02-28T12:06:01Z")

</div>

据我所知，无法实现这一点——但我可能错了。或许支持 {:rel=“nofollow”} 语法（一些 Markdown 引擎已经支持）会是个好主意？

例如：`[Google](https://google.com){:rel="nofollow"}`

---

<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 年2 月 29 日 20:18 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/4 "2020-02-29T20:18:48Z")

</div>

我不明白为什么有人需要这个功能，因此基于这一点，它不太可能实现。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2020 年9 月 16 日 15:13 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/5 "2020-09-16T15:13:03Z")

</div>

有时不得不使用质量很低的链接来回答（或告知）某些事情。我现在就遇到了这种情况，因此才找到了这个话题。不过，最后一点是，通过给予这些网站一点更好的 SEO 价值（即入站链接）来奖励它们。当然，nofollow 只是一个建议，但这是一个强有力的建议。因此，管理员可能希望总体上允许链接跟随，但并非总是如此。我不明白为什么 nofollow 应该是一个开/关选项。

---

<div class="post-metadata">

### Author: ![riteshsaini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riteshsaini/32/266453_2.png) [@riteshsaini](https://meta.discourse.org/u/riteshsaini)
#### Post date: [2020 年12 月 4 日 07:45 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/6 "2020-12-04T07:45:40Z")

</div>

顶一下

我遇到了同样的问题。我作为管理员正在为我的帖子添加一些外部链接，我希望这些链接被标记为 nofollow。但 Discourse 让添加 rel=nofollow 变得过于复杂。

我该怎么办？

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020 年12 月 4 日 10:44 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/7 "2020-12-04T10:44:47Z")

</div>

> [@riteshsaini](#):
>
> 我该怎么办？

你可以编写一个插件，或者在 #Marketplace 频道请求元插件开发者为你编写。

我建议你先查看 `post.rb` 模型中的这段代码片段：

```ruby
def add_nofollow?
    return false if user&.staff?
    user.blank? || SiteSetting.tl3_links_no_follow? || !user.has_trust_level?(TrustLevel[3])
  end

```

你可以在开源仓库中找到这里，所有相关知识都能在此获取 🙂

> <https://github.com/discourse/discourse/blob/ab314218d3026eb3d45c3dbc0d3320d072694cf3/app/models/post.rb>

---

<div class="post-metadata">

### Author: ![guidoleenders](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidoleenders/32/196268_2.png) [@guidoleenders](https://meta.discourse.org/u/guidoleenders)
#### Post date: [2021 年9 月 4 日 19:50 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/8 "2021-09-04T19:50:07Z")

</div>

也遇到同样的问题：需要使用一个权限较低的独立账户，以避免在不需要时自动添加关注。

这种方案会很实用。如果能结合一个网站列表，对这些网站（例如竞争对手）永远不添加关注，那就更好了。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2021 年9 月 4 日 20:17 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/9 "2021-09-04T20:17:34Z")

</div>

“nofollow”如今已毫无意义。Google 会自行判断是否遵循该标签，而大多数情况下并不会遵循（即使标记了 nofollow 也无济于事 😅）。

---

<div class="post-metadata">

### Author: ![guidoleenders](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guidoleenders/32/196268_2.png) [@guidoleenders](https://meta.discourse.org/u/guidoleenders)
#### Post date: [2021 年9 月 4 日 20:18 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/10 "2021-09-04T20:18:31Z")

</div>

对于索引来说相关性较低，但据我所知，链接权重仍然会被分配。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2021 年9 月 4 日 20:26 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/11 "2021-09-04T20:26:53Z")

</div>

不，术语“链接权重”已经过时了，SEO 价值如今来自完全不同的指标。nofollow 属性在此也无实际意义。只要 Googlebot 跟随该链接，无论是否带有 nofollow，都会被计入。

唯一的解决办法是：不要添加链接——但目前还缺少一种工具，能在确实需要 nofollow 时自动删除链接。

这种情况（尽管背景不同）与许多网站管理员仍误以为 H 标签与 SEO 有关时如出一辙 😉

---

<div class="post-metadata">

### Author: ![Rukou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rukou/32/276188_2.png) [@Rukou](https://meta.discourse.org/u/Rukou)
#### Post date: [2022 年10 月 6 日 20:03 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/13 "2022-10-06T20:03:05Z")

</div>

> [@codinghorror](#):
>
> 我无法理解为什么有人想要这个功能，所以基于这个原因，它不太可能实现。

请理解这可能是一种需求。我希望拥有一个自私的外部链接策略，无论权限如何。

> [@Jagster](#):
>
> 不。术语“链接权重”已经过时了，但 SEO 价值来自完全不同的指标。Nofollow 在那里也没有意义。如果 Googlebot 跟随该链接，它就会被计算在内，无论是否有 nofollow。
> 
> 只有一个解决方案：不要链接 — 而这种工具现在缺失了：当真的想要 nofollow 时自动删除链接。
> 
> 这和网站管理员仍然相信 H 标签与 SEO 有关的情况一样（但故事不同）；）

你能提供一些关于你说法来源的资料吗？

[限定你的外部链接。](https://developers.google.com/search/docs/crawling-indexing/qualify-outbound-links)  
[反向链接仍然是排名信号。](https://developers.google.com/search/blog/2019/09/evolving-nofollow-new-ways-to-identify#:~:text=By%20shifting%20to%20a%20hint%20model%2C%20we%20no%20longer%20lose%20this%20important%20information%2C%20while%20still%20allowing%20site%20owners%20to%20indicate%20that%20some%20links%20shouldn%27t%20be%20given%20the%20weight%20of%20a%20first%2Dparty%20endorsement.)  
[SEO 新手指南 101…](https://developers.google.com/search/docs/fundamentals/seo-starter-guide#headingtags)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2022 年10 月 6 日 21:31 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/14 "2022-10-06T21:31:54Z")

</div>

现在我不得不问……你行不行？那些链接中没有一个能证明你所说的。你可以开始谷歌搜索 googlebot+nofollow。

你现在问我是否愿意了解排名的基本原理。抱歉——你问这个问题花了大约一分钟，现在我应该花大约 12 小时来向你解释。这不是很……公平的要求。

但如果你不愿意自己搜索和学习，可以重读那些资源——其中提到“仍然”和“信号”的那个是一个很好的起点。而且你必须理解谷歌机器人何时会跟踪 AND 不会跟踪名为 nofollow 的请求。

---

<div class="post-metadata">

### Author: ![Rukou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rukou/32/276188_2.png) [@Rukou](https://meta.discourse.org/u/Rukou)
#### Post date: [2022 年10 月 6 日 21:35 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/15 "2022-10-06T21:35:15Z")

</div>

举证责任在你，伙计。你提出了主张，我提供了来自谷歌的、与你主张相矛盾的来源。

---

<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: [2022 年10 月 7 日 02:29 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/16 "2022-10-07T02:29:03Z")

</div>

Googlebot _会_跟踪 `nofollow` 链接，但 `nofollow` **仍然** 是算法会遵守的一个有效提示。

`sponsored` 和 `ugc` 也是有效的属性，并且已经存在大约三年了。

[来源](https://developers.google.com/search/blog/2019/09/evolving-nofollow-new-ways-to-identify)

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2022 年10 月 7 日 06:08 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/17 "2022-10-07T06:08:26Z")

</div>

> [@Stephen](#):
>
> 算法 **仍然观察到** 的有效 **提示**

像任何东西一样。但它仍然只是一个提示，谷歌会根据相关性自行决定，而不是根据 nofollow。这就是为什么没有人可以信任或依赖它。

事情不同，但类似：有时谷歌会遵循 robots.txt，有时它甚至不 bother 看它，并且绝对不遵循它。Gmail 中的链接是最广为人知的情况。

---

<div class="post-metadata">

### Author: ![Rukou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rukou/32/276188_2.png) [@Rukou](https://meta.discourse.org/u/Rukou)
#### Post date: [2022 年10 月 7 日 15:33 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/18 "2022-10-07T15:33:21Z")

</div>

好的。我认为我明白你的意思了，但你传播的错误信息是极其危险的建议。让我 **花点时间** 来解释我的说法。这里可能存在沟通障碍，我假设你声称“nofollow”完全没有意义。

> [@Jagster](#):
>
> nofollow 今天毫无意义。谷歌自己决定是否跟踪它，但通常不会（跟踪 nofollow 😅）。

你为什么关心谷歌索引你域名之外的内容？如果你关心自己的页面不被索引，请使用 [robots 元标签](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#:~:text=The%20%3Cmeta%20name%3D%22robots%22%20content%3D%22noindex%22%3E%20tag%20or%20directive%20applies%20to%20search%20engine%20crawlers.%20To%20block%20non%2Dsearch%20crawlers%2C%20such%20as%20AdsBot%2DGoogle%2C%20you%20might%20need%20to%20add%20directives%20targeted%20to%20the%20specific%20crawler%20(for%20example%2C%20%3Cmeta%20name%3D%22AdsBot%2DGoogle%22%20content%3D%22noindex%22%3E)%E3%80%82) 和 [robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro)。不要仅仅依赖 robots.txt，[如这里所示](https://developers.google.com/search/docs/crawling-indexing/robots/intro#:~:text=Warning%3A%20Don%27t%20use%20a%20robots.txt%20file%20as%20a%20means%20to%20hide%20your%20web%20pages%20from%20Google%20search%20results.)。

 ![Screenshot_1](https://global.discourse-cdn.com/meta/original/4X/9/4/9/9495c8492d09c3a05d600ccc5eba7e024f118d17.png)

Nofollow 并非无用或无意义。它是一种自私的策略，保留了 [pagerank](http://ilpubs.stanford.edu:8090/422/1/1999-66.pdf)（谷歌创始人白皮书）。Pagerank 作为最初的排名因素可能在今天并不突出，但不要说带有 nofollow 的限定链接是毫无意义的。这种笼统的说法是危险的、误导性的，而且是懒惰的。

> [@Jagster](#):
>
> 不。术语“链接权重”已经过时，但 SEO 价值来自完全不同的指标。Nofollow 在那里也没有任何意义。如果 googlebot 跟踪该链接，它就会被计算在内，无论是否有 nofollow。

我同意“链接权重”已经过时并且是行业术语，但 pagerank 仍然是一个关键的排名因素。请参阅 [Ahrefs 关于 pagerank 的博客文章](https://ahrefs.com/blog/google-pagerank/)。同样，只要你控制了认可和关联，谁还在乎谷歌跟踪什么呢？

> [@Jagster](#):
>
> nofollow 今天毫无意义。谷歌自己决定是否跟踪它，但通常不会（跟踪 nofollow 😅）。

再说一遍，只要你控制了认可和关联，谁还在乎谷歌跟踪什么呢？ **请参阅帖子顶部了解 noindex。**

> [@Jagster](#):
>
> 现在我必须问……你能吗？那些链接都没有说明你所声称的内容。你可以开始谷歌搜索 googlebot+nofollow。
> 
> 你现在问我是否愿意讲解排名的基本原理。抱歉——你问这个问题花了大约一分钟，现在我需要花大约 12 个小时来向你解释。这并不是……一个非常平衡的要求。
> 
> 但如果你不愿意自己搜索和学习，你可以重读那些资源——其中有“仍然”和“信号”这个词的那个是一个很好的起点。而且你仍然需要理解 googlebot 何时跟踪以及何时不跟踪名为 nofollow 的请求。

这些是基本概念，我已经为你阐述清楚了。你可能是个网站管理员，但数字营销是我的全职工作。SEO 是我日常工作的一部分。

> [@Jagster](#):
>
> 像任何事情一样。但这仍然只是一个提示，谷歌会根据相关性自己做出决定，而不是根据 nofollow。这就是为什么没有人可以信任或依赖它。
> 
> 这是不同的事情，但相似的：有时 google 会跟踪 robots.txt，有时它根本不 bother 甚至不看它，而且绝对不跟踪它。Gmail 中的链接是最广为人知的情况。

**请参阅帖子顶部了解 noindex。**

---

<div class="post-metadata">

### Author: ![stance455](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stance455/32/255345_2.png) [@stance455](https://meta.discourse.org/u/stance455)
#### Post date: [2023 年4 月 6 日 23:43 UTC](https://meta.discourse.org/t/available-site-settings-to-configure-nofollow-for-links-posted-by-users/93004/19 "2023-04-06T23:43:36Z")

</div>

> [@robmc](#):
>
> 默认情况下，TL3 用户将具有可跟踪链接。勾选此框可移除此排除项，并 **将所有用户链接保留为 rel=nofollow**

点击此选项后，我是否需要“重新烘焙”帖子才能使其生效？- 我是论坛的管理员，信任级别为 4，似乎外部链接是 dofollow 的，我想更改它。

**编辑** 刚重读了上面的帖子，似乎不止我一个人。我假设管理员没有变通方法？
