本页介绍了如何使用 schema.org JSON-LD 并借助 CreativeWork
属性指明网站上的付费内容。该结构化数据有助于 Google 区分付费内容与伪装真实内容的做法(此做法违反了我们的指南)。详细了解订阅和付费内容。
示例
下面是一个付费内容的 NewsArticle
结构化数据示例。
<html> <head> <title>Article headline</title> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "NewsArticle", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://example.org/article" }, "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" }, "publisher": { "name": "The Exemplary Times", "@type": "Organization", "logo": { "@type": "ImageObject", "url": "https://example.org/logo.jpg" } }, "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 版本)执行以下步骤。
- 在网页的每个付费版块周围添加一个类名。例如:
<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>
- 添加
NewsArticle
结构化数据。 - 将突出显示的 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" } }
多个付费版块
如果网页上有多个付费版块,请以数组的形式添加类名。
下面是网页上的多个付费版块的示例:
<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, and 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": ["CreativeWork","Article","Person"]
AMP 注意事项
下面是您在使用 AMP 网页时需注意的一些事项:
- 如果您有包含付费内容的 AMP 网页,请在适当的情况下使用 amp-subscriptions。
- 确保您的授权端点准许 Google 及其他方的相应漫游器访问内容。这一点因发布商不同而异。
- 确保您的漫游器访问策略对于 AMP 和非 AMP 网页是相同的,否则可能会导致 Search Console 中出现内容不匹配错误。
确保 Google 可以抓取您的网页并将其编入索引
您可以通过下面几种方法确保 Google 可以抓取您网页上的内容并将其编入索引:
- 如果您只希望 Google 抓取网页上那些在付费墙以外且所有人都可以看到的内容并将这些内容编入索引,请跳过此步骤。
- 如果您希望 Google 抓取您的整个网页(包括付费版块)并将其编入索引,请确保 Googlebot 和 Googlebot-News(如果适用)可以访问您的网页。
- 如果您希望阻止 Google 显示网页的缓存链接,请使用
noarchive
漫游器元标记。
问题排查
如果您在实施结构化数据时遇到问题,请查看下面列出的一些实用资源。
- 您的结构化数据可能存在错误。请参阅结构化数据错误列表。
- 针对富媒体搜索结果缺失/富媒体搜索结果总数下降进行问题排查。
- 有关抓取和索引编制的常见问题,请参阅网站站长常见问题解答。
- 在网站站长 Office Hours 活动中提问。
- 在网站站长论坛中发帖提问。