使用结构化数据标记常见问题解答

常见问题解答 (FAQ) 页包含一系列有关特定主题的问题和答案。如果您正确标记了 FAQ 页,它们可能会在 Google 搜索中显示为富媒体搜索结果,并可生成一个 Google 助理操作,从而帮助您的网站覆盖合适的用户。下面是 FAQ 富媒体搜索结果的示例:

FAQ 富媒体搜索结果图片

如何添加结构化数据

结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的工作原理

下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab

  1. 添加必要属性。如需了解如何在网页上放置结构化数据,请观看 JSON-LD 结构化数据:网页上的插入位置
  2. 遵循指南
  3. 使用富媒体搜索结果测试验证您的代码。
  4. 部署一些包含结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、noindex 标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址
  5. 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

功能可用性

FAQ 富媒体搜索结果目前适用于所有可以使用 Google 搜索的国家/地区和语言,既支持桌面设备,也支持移动设备。

示例

JSON-LD

下面是一个 JSON-LD 格式的 FAQPage 示例:


<html>
  <head>
    <title>Example Site - Frequently Asked Questions(FAQ)</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "What is the return policy?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href=http://example.com/returns> Click here </a> to initiate a return.</p>"
        }
      }, {
        "@type": "Question",
        "name": "How long does it take to process a refund?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
        }
      }, {
        "@type": "Question",
        "name": "What is the policy for late/non-delivery of items ordered online?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href=https://example.com/orders/>Click here</a> to complete the form with your order-related question(s).</p>"
        }
      }, {
        "@type": "Question",
        "name": "When will my credit card be charged?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
        }
      }, {
        "@type": "Question",
        "name": "Will I be charged sales tax for online orders?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
        }]
    }
    </script>
  </head>
  <body>
  </body>
</html>
微数据

下面是一个微数据格式的 FAQPage 示例:


<html itemscope itemtype="https://schema.org/FAQPage">
<head>
  <title>Example Site - Frequently Asked Questions(FAQ)</title>
    </head>
<body>
  <div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
    <h3 itemprop="name">What is the return policy?</h3>
    <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
      <div itemprop="text">
        Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.
        <br /><p>Online purchases may be returned via a major parcel carrier. <a href="http://example.com/returns"> Click here </a> to initiate a return.</p>
      </div>
    </div>
  </div>
  <div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
    <h3 itemprop="name">How long does it take to process a refund?</h3>
    <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
      <div itemprop="text">
        We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time.
    </div>
  </div>
</div>
<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
  <h3 itemprop="name">What is the policy for late/non-delivery of items ordered online?</h3>
  <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
    <div itemprop="text">
      Our local teams work diligently to make sure that your order arrives on time, within our normal delivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue.
      <br/> <p><a href="https://example.com/orders/">Click here</a> to complete the form with your order-related question(s).</p>
    </div>
  </div>
</div>
<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
  <h3 itemprop="name">When will my credit card be charged?</h3>
  <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
    <div itemprop="text">
      We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours.
    </div>
  </div>
</div>
<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
  <h3 itemprop="name">Will I be charged sales tax for online orders?</h3>
  <div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
    <div itemprop="text">
      Local and State sales tax will be collected if your recipient's mailing address is in:
      <ul>
        <li>Arizona</li>
        <li>California</li>
        <li>Colorado</li>
      </ul>
    </div>
  </div>
</div>
  </body>
</html>

指南

要让 FAQ 页能够显示为 FAQ 富媒体搜索结果,您必须遵循以下指南:

内容指南

  • 仅在您的网页中有一系列附有答案的问题时使用 FAQPage。如果您的网页中只列出了一个问题且用户可以提交备选答案,请改用 QAPage。下面是一些示例:

    有效用例

    • 一个由网站本身编写的常见问题解答页,用户无法在该网页上提交备选答案
    • 一个列有常见问题解答的产品支持页,用户无法在该网页上提交备选答案

    无效用例

    • 一个论坛网页,用户可以在该网页上提交单个问题的答案
    • 一个产品支持页,用户可以在该网页上提交单个问题的答案
    • 一个产品页,用户可以在单个页面上提交多个问题和答案
  • 请勿将 FAQPage 用于广告宣传。
  • 确保每个 Question 都包含完整的问题内容,并确保每个 Answer 都包含完整的答案内容。可以显示整个问题和答案内容。
  • 如果问题和答案包含以下任何类型的内容,那么它们可能不会显示为富媒体搜索结果:淫秽、亵渎、露骨色情、血腥暴力、宣传危险/违法活动,或仇恨性/骚扰性语言。
  • 必须在来源网页上向用户显示所有 FAQ 内容。
  • 如果您的网站上存在重复的 FAQ 内容(也就是说,相同的问题和答案出现在您网站的多个网页上),在整个网站上,请仅标记一处该内容。

结构化数据类型定义

如果要使你的内容能够显示为富媒体搜索结果,你必须为它添加必需的属性。您还可以添加建议属性,以便向结构化数据添加更多信息,进而提供更好的用户体验。

FAQPage

schema.org 上提供了 FAQPage 的完整定义。

FAQPage 类型表示网页是包含已获解答问题的 FAQ 页。每个网页都必须有一个 FAQPage 类型定义。

必需的属性
mainEntity Question

Question 为元素的数组,包含 FAQPage 上附有答案的问题。

Question

如需了解 Question 的完整定义,请访问 schema.org。

Question 类型定义了 FAQ 中的一个已获解答的问题。每个 Question 实例都必须包含在 schema.org/FAQPagemainEntity 属性数组中。

必需的属性
acceptedAnswer Answer

问题的答案。每个问题必须有一个答案。

name Text

问题的完整内容。例如,“处理退款需要多长时间?”。

Answer

如需了解 Answer 的完整定义,请访问 schema.org。

Answer 类型定义了相应网页上每个 QuestionacceptedAnswer

必需的属性
text Text

问题的完整答案。答案可能包含 HTML 内容(如链接和列表)。Google 搜索会显示以下 HTML 标记,所有其他标记均会被忽略:<h1><h6><br><ol><ul><li><a><p><div><b><strong><i><em>

使用 Search Console 监控富媒体搜索结果

Search Console 是一款工具,可帮助您监控网页在 Google 搜索结果中的显示效果。即使没有注册 Search Console,您的网页也可能会显示在 Google 搜索结果中,但注册 Search Console 能够帮助您了解 Google 如何查看您的网站并做出相应的改进。建议您在以下情况下查看 Search Console:

  1. 首次部署结构化数据后
  2. 发布新模板或更新代码后
  3. 定期分析流量时

首次部署结构化数据后

等 Google 将网页编入索引后,请在相关的富媒体搜索结果状态报告中查看是否存在问题。 理想情况下,您应该会看到有效网页数增加了,但错误数或警告数没有增加。如果您发现结构化数据存在问题,请执行以下操作:

  1. 修正错误
  2. 检查实际网址,核实问题是否仍然存在。
  3. 使用状态报告请求验证

发布新模板或更新代码后

对网站进行重大更改后,请监控结构化数据的错误数和警告数是否增加了。
  • 如果您发现错误增多了,可能是因为您推出的某个新模板无法正常工作,或者您的网站以一种新的错误方式与现有模板交互。
  • 如果您发现有效内容项减少了(但错误数的增加情况并不对应),可能是因为您的网页中未再嵌入结构化数据。请通过网址检查工具了解导致此问题的原因。

定期分析流量时

请使用效果报告分析您的 Google 搜索流量。数据将显示您的网页在 Google 搜索结果中显示为富媒体搜索结果的频率、用户点击该网页的频率以及网页在搜索结果中的平均排名。您还可以使用 Search Console API 自动提取这些结果。

问题排查

如果您在实施结构化数据时遇到问题,请查看下面列出的一些实用资源。