订阅和付费内容结构化数据 (CreativeWork)

本页介绍了如何使用 schema.org JSON-LD 并借助 CreativeWork 属性指明网站上的付费内容。该结构化数据有助于 Google 区分付费内容与伪装真实内容的行为,后者违反了网络垃圾政策。详细了解订阅和付费内容

示例

下面是一个包含付费内容的 NewsArticle 结构化数据示例。

<html>
  <head>
    <title>Article headline</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "NewsArticle",
      "headline": "Article headline",
      "image": "https://example.org/thumbnail1.jpg",
      "datePublished": "2025-02-05T08:00:00+08:00",
      "dateModified": "2025-02-05T09:20:00+08:00",
      "author": {
        "@type": "Person",
        "name": "John Doe",
        "url": "https://example.com/profile/johndoe123"
      },
      "description": "A most wonderful article",
      "isAccessibleForFree": false,
      "hasPart":
        {
        "@type": "WebPageElement",
        "isAccessibleForFree": false,
        "cssSelector" : ".paywall"
        }
    }
    </script>
  </head>
  <body>
    <div class="non-paywall">
      Non-Paywalled Content
    </div>
    <div class="paywall">
      Paywalled Content
    </div>
  </body>
</html>

指南

您必须遵循结构化数据常规指南技术指南,这样您的网页才能够显示在搜索结果中。此外,付费内容还需要遵循以下指南:

  • 可以使用 JSON-LD 和微数据格式这两种方法来指定付费内容的结构化数据。
  • 不要嵌套内容版块。
  • 仅对 cssSelector 属性使用 .class 选择器。

向付费内容添加标记

如果您为您的网站内容采用任何基于订阅的访问模式,或者如果用户必须注册才能访问您要编入索引的任何内容,请按相应步骤操作。以下示例适用于 NewsArticle 结构化数据。请务必对网页的所有版本(包括 AMP 和非 AMP 版本)执行以下步骤。

  1. 在网页的每个付费版块周围添加一个类名。例如:
    <body>
    <p>This content is outside a paywall and is visible to all.</p>
    <div class="paywall">This content is inside a paywall, and requires a subscription or registration.</div>
    </body>
  2. 添加 NewsArticle 结构化数据。
  3. 将突出显示的 JSON-LD 结构化数据添加到您的 NewsArticle 结构化数据。
    {
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.org/article"
    },
    (...)
    "isAccessibleForFree": false,
    "hasPart": {
    "@type": "WebPageElement",
    "isAccessibleForFree": false,
    "cssSelector": ".paywall"
    }
    }
  4. 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。

多个付费版块

如果网页上有多个付费版块,请以数组的形式添加类名。

下面是网页上的多个付费版块的示例:

<body>
<div class="section1">This content is inside a paywall, and requires a subscription or registration.</div>
<p>This content is outside a paywall and is visible to all.</p>
<div class="section2">This is another section that's inside a paywall, or requires a subscription or registration.</div>
</body>

下面是一个包含多个付费版块的 NewsArticle 结构化数据示例。

{
  "@context": "https://schema.org",
  "@type": "NewsArticle",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.org/article"
    },
  (...)
  "isAccessibleForFree": false,
  "hasPart": [
    {
      "@type": "WebPageElement",
      "isAccessibleForFree": false,
      "cssSelector": ".section1"
    }, {
      "@type": "WebPageElement",
      "isAccessibleForFree": false,
      "cssSelector": ".section2"
    }
  ]
}

支持的类型

此标记适用于 CreativeWork 类型或以下某一特定类型的 CreativeWork

可以使用多个 schema.org 类型,如下所示:

"@type": ["Article", "LearningResource"]

您必须添加必要属性,Google 才能知道您的文章包含付费内容。您可以添加建议的属性,以便更精确地指出网页的哪些版块隐藏在付费墙后面(或者需要订阅或注册)。

必要属性
isAccessibleForFree

Boolean

文章是否可供所有人访问,或是否隐藏在付费墙后面(或者需要订阅或注册)。将 isAccessibleForFree 属性设置为 false,即可指定此版块隐藏在付费墙后面。

建议的属性
hasPart.cssSelector

CssSelectorType

CSS 选择器,会引用您在 HTML 中设置的类名,以指定付费版块。

hasPart.@type

Text

@type 设置为 WebPageElement

hasPart.isAccessibleForFree

Boolean

文章的这一版块是否隐藏在付费墙后面(或者需要订阅或注册)。将 isAccessibleForFree 属性设置为 False,即可指定此版块隐藏在付费墙后面。

AMP 注意事项

下面是您在使用 AMP 网页时需注意的一些事项:

  • 如果您有包含付费内容的 AMP 网页,请在合适的情况下使用 amp-subscriptions
  • 确保您的授权端点准许 Google 及其他方的相应漫游器访问内容。具体操作方法因发布商不同而异。
  • 确保对 AMP 和非 AMP 网页实施相同的漫游器访问政策,否则可能会导致 Search Console 中出现内容不匹配错误。

Google 搜索中的生成式 AI 注意事项

SGE(生成式搜索体验)概览是在 AI 的帮助下生成的。生成依据为网上的信息和 Google 知识图谱;知识图谱是有关人物、地点和事物的信息集合。使用摘要控件屏蔽的内容不会显示在概览中。

SGE 旨在帮助用户发现网络上的有用信息,这些信息为概览中的信息提供支持,并为用户提供深入探索的切入点。随着 Google 搜索功能持续扩展,SGE 概览可能会包含指向付费内容的链接,以便用户探索这些网页。

与 Google 搜索中的 SGE 不同,浏览时的 SGE 是一项独立功能,如果网页上包含付费墙结构化数据,则不会显示付费文章的要点。

确保 Google 可以抓取您的网页并将其编入索引

如果您希望 Google 抓取您的内容(包括付费版块)并将其编入索引,请确保 GooglebotGooglebot-News(如果适用)可以访问您的网页。

使用网址检查工具测试 Google 会如何抓取并呈现您网站上的某个网址。

控制在搜索结果中显示哪些信息

若要阻止 Google 显示网页的缓存链接,请使用 noarchive robots meta 标记

若要阻止内容的某些部分显示在搜索结果摘要中,请使用 data-nosnippet HTML 属性。您还可以使用 max-snippet robots meta 标记来限制搜索结果摘要中可以包含多少字符。

Troubleshooting

If you're having trouble implementing or debugging structured data, here are some resources that may help you.

  • If you're using a content management system (CMS) or someone else is taking care of your site, ask them to help you. Make sure to forward any Search Console message that details the issue to them.
  • Google does not guarantee that features that consume structured data will show up in search results. For a list of common reasons why Google may not show your content in a rich result, see the General Structured Data Guidelines.
  • You might have an error in your structured data. Check the list of structured data errors.
  • If you received a structured data manual action against your page, the structured data on the page will be ignored (although the page can still appear in Google Search results). To fix structured data issues, use the Manual Actions report.
  • Review the guidelines again to identify if your content isn't compliant with the guidelines. The problem can be caused by either spammy content or spammy markup usage. However, the issue may not be a syntax issue, and so the Rich Results Test won't be able to identify these issues.
  • Troubleshoot missing rich results / drop in total rich results.
  • Allow time for re-crawling and re-indexing. Remember that it may take several days after publishing a page for Google to find and crawl it. For general questions about crawling and indexing, check the Google Search crawling and indexing FAQ.
  • Post a question in the Google Search Central forum.