# Posts 结构化数据：作者 URL 被“noindex”阻止

**URL:** <https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490>\
**Category:** Development\
**Created:** [2022 年3 月 20 日 17:53 UTC](https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490 "2022-03-20T17:53:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)\
发布日期： [2022 年3 月 20 日 17:53 UTC](https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490/1 "2022-03-20T17:53:13Z")

</div>

在每个帖子的结构化数据中，都有一个指向作者页面的 URL：

```xml
<div id="post_123" itemscope="" itemtype="http://schema.org/DiscussionForumPosting" class="topic-body crawler-post">
  <div class="crawler-post-meta">
    [...]
    <span class="creator" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <a itemprop="url" href="https://meta.discourse.org/u/codinghorror">
        <span itemprop="name">codinghorror</span>
      </a>
      (Jeff Atwood)
    </span>

```

这些作者页面被 `noindex` 的 http 标头阻止。Google 希望所有结构化数据都可访问 - 请参阅 [General Structured Data Guidelines | Google Search Central &nbsp;|&nbsp; Documentation &nbsp;|&nbsp; Google for Developers](https://developers.google.com/search/docs/advanced/structured-data/sd-policies?hl=en#access%EF%BC%9A)

> [@](#):
>
> ### 访问
> 
> 请勿使用 robots.txt、`noindex` 标签或任何其他访问控制方法阻止 Googlebot 访问您的结构化数据页面。

* * *

Google 推荐作者 URL - 请参阅 [Learn About Article Schema Markup | Google Search Central &nbsp;|&nbsp; Documentation &nbsp;|&nbsp; Google for Developers](https://developers.google.com/search/docs/advanced/structured-data/article?hl=en#non-amp)

> [@](#):
>
> `author.url` `URL`  
> 指向唯一标识文章作者的网页的链接。例如，作者的社交媒体页面、关于我页面或简介页面。
> 
> 您也可以改用 `sameAs` 属性。Google 在区分作者时可以理解 `sameAs` 和 `url`。

* * *

### Discourse 是否应该隐藏作者的 URL？

隐藏 URL 可以通过使用 `itemid` 属性将同一作者的所有帖子链接到同一个作者对象，而不设置任何 URL 来实现。

当前状态：

```xml
<span class="creator"
      itemprop="author" itemscope="" itemtype="http://schema.org/Person">
  <a itemprop="url" href="https://meta.discourse.org/u/codinghorror">
    <span itemprop="name">codinghorror</span>
  </a>
  (Jeff Atwood)
</span>

```

移除 `url` 属性并添加 `itemid` 属性的 `identifier` - 另外设置 `rel="nofollow"`：

```xml
<span class="creator"
      itemid="https://meta.discourse.org/u/codinghorror"
      itemprop="author" itemscope="" itemtype="http://schema.org/Person">
  <a rel="nofollow" href="https://meta.discourse.org/u/codinghorror">
    <span itemprop="name">codinghorror</span>
  </a>
  (Jeff Atwood)
</span>

```

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/0/2/0280116f00d10fa6c6f218007396f5a4e5914c52.png)

---

_[View the full topic](https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490)._
