课程列表 (Course) 结构化数据

课程列表在 Google 搜索结果中的显示效果图示。它以列表形式显示同一网站中的 3 门不同课程,用户可以浏览列表并选择特定课程

借助课程列表结构化数据,您可以提供有关您的课程的更多信息,以便潜在学生通过 Google 搜索找到您的课程。您可以提供详细信息,包括课程名称、提供者和简短说明。

以下介绍两项课程富媒体搜索结果功能,它们使用了相同的 schema.org Course 类型。如果您的网站提供课程相关信息,您便可以按照以下两个实现指南来使用这两项功能:

  • 课程列表:一种富媒体搜索结果,会列出来自同一网站上的课程。
  • 课程信息:一个轮播界面,会显示来自多个网站的详细课程信息。

如何添加结构化数据

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

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

  1. 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据
  2. 遵循指南
  3. 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
  4. 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、noindex 标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址
  5. 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

示例

课程详情单一页面

下面是一个课程详情单一页面的示例。此页面必须与包含 ItemList 标记摘要页面配对。


<html>
  <head>
    <title>Introduction to Computer Science and Programming</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Course",
      "name": "Introduction to Computer Science and Programming",
      "description": "Introductory CS course laying out the basics.",
      "provider": {
        "@type": "Organization",
        "name": "University of Technology - Eureka",
        "sameAs": "https://www.example.com"
      }
    }
    </script>
  </head>
  <body>
  </body>
</html>

全包式单一页面

下面是一个全包式单一页面的示例。 此页面设置在同一页面上包含各门课程的列表标记和详细信息。


<html>
  <head>
    <title>Computer Science Courses</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "ItemList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "item": {
            "@type": "Course",
            "url":"https://www.example.com/courses#intro-to-cs",
            "name": "Introduction to Computer Science and Programming",
            "description": "This is an introductory CS course laying out the basics.",
            "provider": {
              "@type": "Organization",
              "name": "University of Technology - Example",
              "sameAs": "https://www.example.com"
           }
          }
        },
        {
          "@type": "ListItem",
          "position": 2,
          "item": {
            "@type": "Course",
            "url":"https://www.example.com/courses#intermediate-cs",
            "name": "Intermediate Computer Science and Programming",
            "description": "This is a CS course that builds on the basics learned in the Introduction course.",
            "provider": {
              "@type": "Organization",
              "name": "University of Technology - Example",
              "sameAs": "https://www.example.com"
           }
         }
        },
        {
          "@type": "ListItem",
          "position": 3,
          "item": {
            "@type": "Course",
            "url":"https://www.example.com/courses#advanced-cs",
            "name": "Advanced Computer Science and Programming",
            "description": "This CS course covers advanced programming principles.",
            "provider": {
              "@type": "Organization",
              "name": "University of Technology - Eureka",
              "sameAs": "https://www.example.com"
           }
          }
        }
      ]
    }
    </script>
  </head>
  <body>
  </body>
</html>

指南

您的课程必须遵循以下指南,才能出现在课程列表中。

内容指南

  • 仅对符合下述课程定义的教育内容使用 Course 标记:围绕特定主题和/或话题展开,且包含讲座、课程或模块的课程系列或单元。
  • 课程必须围绕特定主题和/或话题展开,在知识和/或技能方面有明确的教育成果,由一位或多位教师讲授并且有学生名单。
  • 诸如“天文日”之类的一般公众活动不是课程,一段 2 分钟的“如何制作三明治”视频也不是课程。

技术指南

您必须至少标记三门课程。这些课程可以位于不同的详情页面中,也可以位于全包式页面中。

您必须将轮播界面标记添加到摘要页面全包式页面

每门课程必须具有有效的 nameprovider 属性。例如,以下命名方式均无效:

  • 推广用语:“世界上最好的学校”
  • 课程标题中包含价格:“学尤克里里 - 只需 30 美元!”
  • 使用非课程内容作为标题,如:“学习这门课程,掌握快速赚钱秘诀!”
  • 折扣或购买机会,如:“各领域的佼佼者分享了他们的秘诀 - 报名听课可享七五折优惠!”

结构化数据类型定义

若要使您的内容能够显示为富媒体搜索结果,您必须为其添加必要属性。 您还可添加建议属性,以便添加与内容相关的更多信息,进而提供更优质的用户体验。

Course

使用以下属性标记至少三个课程。这些课程可以位于不同的详情页面中,也可以位于全包式页面中。

如需了解 Course 的完整定义,请访问 schema.org/Course。Google 支持的属性如下:

必要属性
description

Text

课程的说明。最多显示 60 个字符。

name

Text

课程的标题。

建议的属性
provider

Organization

发布课程来源内容的组织。例如,加州大学伯克利分校。

ItemList

除了 Course 属性之外,还可以添加以下属性来指定课程列表。您可以将这些属性添加到摘要页面全包式页面中。

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

必要属性
itemListElement

ListItem

单个项目网页的注释。

ListItem.position

Integer

项目网页在列表中的序号位置。

ListItem.url

URL

项目网页的规范网址。每个项目都必须具备一个独一无二的网址。

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 and the Unparsable structured data report.
  • 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.