Dữ liệu có cấu trúc loại Breadcrumb (BreadcrumbList)

Breadcrumb trong kết quả tìm kiếm

Đường dẫn breadcrumb trên một trang cho biết vị trí của trang trong hệ thống phân cấp trang web và có thể giúp người dùng hiểu cũng như khám phá trang web một cách hiệu quả. Người dùng có thể di chuyển từng cấp một lên cấp trên cùng của hệ thống phân cấp trang web, bắt đầu từ breadcrumb sau cùng trong đường dẫn breadcrumb.

Phạm vi cung cấp tính năng

Google cung cấp tính năng này trên máy tính cũng như ở mọi khu vực và ngôn ngữ mà người dùng có thể truy cập Google Tìm kiếm.

如何添加结构化数据

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

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

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

Ví dụ

Google Tìm kiếm sử dụng mã đánh dấu breadcrumb trong phần nội dung của trang web để phân loại thông tin trên trang trong kết quả tìm kiếm. Thông thường, người dùng có thể truy cập một trang thông qua các loại cụm từ tìm kiếm rất khác nhau, như được minh họa trong các trường hợp sử dụng sau đây. Mặc dù mỗi cụm từ tìm kiếm có thể trả về cùng một trang web, breadcrumb sẽ phân loại nội dung theo ngữ cảnh của cụm từ đó trên Google Tìm kiếm. Trang dành cho những người chiến thắng giải thưởng sách tiểu thuyết có thể sử dụng các đường dẫn breadcrumb sau:

Một đường dẫn breadcrumb

Nếu chỉ có một đường dẫn breadcrumb có thể dẫn đến trang, thì trang đó có thể chỉ định đường dẫn breadcrumb sau:

Sách Khoa học viễn tưởng Sách đạt giải thưởng

JSON-LD

Dưới đây là ví dụ về mã JSON-LD hỗ trợ breadcrumb đó:


<html>
  <head>
    <title>Award Winners</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [{
        "@type": "ListItem",
        "position": 1,
        "name": "Books",
        "item": "https://example.com/books"
      },{
        "@type": "ListItem",
        "position": 2,
        "name": "Science Fiction",
        "item": "https://example.com/books/sciencefiction"
      },{
        "@type": "ListItem",
        "position": 3,
        "name": "Award Winners"
      }]
    }
    </script>
  </head>
  <body>
  </body>
</html>

RDFa

Dưới đây là ví dụ về mã RDFa hỗ trợ breadcrumb đó:


<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol vocab="https://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/books">
          <span property="name">Books</span></a>
        <meta property="position" content="1">
      </li>
      ›
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/books/sciencefiction">
          <span property="name">Science Fiction</span></a>
        <meta property="position" content="2">
      </li>
      ›
      <li property="itemListElement" typeof="ListItem">
        <span property="name">Award Winners</span>
        <meta property="position" content="3">
      </li>
    </ol>
  </body>
</html>

Vi dữ liệu

Dưới đây là ví dụ về Vi dữ liệu hỗ trợ breadcrumb đó:


<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol itemscope itemtype="https://schema.org/BreadcrumbList">
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemprop="item" href="https://example.com/books">
            <span itemprop="name">Books</span></a>
        <meta itemprop="position" content="1" />
      </li>
      ›
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemscope itemtype="https://schema.org/WebPage"
           itemprop="item" itemid="https://example.com/books/sciencefiction"
           href="https://example.com/books/sciencefiction">
          <span itemprop="name">Science Fiction</span></a>
        <meta itemprop="position" content="2" />
      </li>
      ›
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <span itemprop="name">Award winners</span>
        <meta itemprop="position" content="3" />
      </li>
    </ol>
  </body>
</html>

HTML

Dưới đây là ví dụ về đoạn breadcrumb HTML trong trang, là một phần của thiết kế hình ảnh.

<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol>
      <li>
        <a href="https://www.example.com/books">Books</a>
      </li>
      <li>
        <a href="https://www.example.com/sciencefiction">Science Fiction</a>
      </li>
      <li>
        Award Winners
      </li>
    </ol>
  </body>
</html>

Nhiều đường dẫn breadcrumb

Nếu có nhiều cách để chuyển đến một trang trên trang web của bạn, bạn có thể chỉ định nhiều đường dẫn breadcrumb cho một trang. Sau đây là một đường dẫn breadcrumb đến một trang về sách đạt giải thưởng:

Sách Khoa học viễn tưởng Sách đạt giải thưởng

Đây là một đường dẫn breadcrumb khác dẫn đến cùng trang đó:

Văn học Sách đạt giải thưởng

JSON-LD

Dưới đây là ví dụ về đoạn mã JSON-LD hỗ trợ nhiều đường dẫn breadcrumb:


<html>
  <head>
    <title>Award Winners</title>
    <script type="application/ld+json">
    [{
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [{
        "@type": "ListItem",
        "position": 1,
        "name": "Books",
        "item": "https://example.com/books"
      },{
        "@type": "ListItem",
        "position": 2,
        "name": "Science Fiction",
        "item": "https://example.com/books/sciencefiction"
      },{
        "@type": "ListItem",
        "position": 3,
        "name": "Award Winners"
      }]
    },
    {
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [{
        "@type": "ListItem",
        "position": 1,
        "name": "Literature",
        "item": "https://example.com/literature"
      },{
        "@type": "ListItem",
        "position": 2,
        "name": "Award Winners"
      }]
    }]
    </script>
  </head>
  <body>
  </body>
</html>

RDFa

Dưới đây là ví dụ về đoạn mã RDFa hỗ trợ nhiều đường dẫn breadcrumb:


<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol vocab="https://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/books">
          <span property="name">Books</span></a>
        <meta property="position" content="1">
      </li>
      ›
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/books/sciencefiction">
          <span property="name">Science Fiction</span></a>
        <meta property="position" content="2">
      </li>
      ›
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/books/sciencefiction/awardwinners">
          <span property="name">Award Winners</span></a>
        <meta property="position" content="3">
      </li>
    </ol>
    <ol vocab="https://schema.org/" typeof="BreadcrumbList">
      <li property="itemListElement" typeof="ListItem">
        <a property="item" typeof="WebPage"
            href="https://example.com/literature">
          <span property="name">Literature</span></a>
        <meta property="position" content="1">
      </li>
      ›
      <li property="itemListElement" typeof="ListItem">
        <span property="name">Award Winners</span>
        <meta property="position" content="2">
      </li>
    </ol>
  </body>
</html>

Vi dữ liệu

Dưới đây là ví dụ về Vi dữ liệu hỗ trợ nhiều đường dẫn breadcrumb:


<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol itemscope itemtype="https://schema.org/BreadcrumbList">
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemprop="item" href="https://example.com/books">
            <span itemprop="name">Books</span></a>
        <meta itemprop="position" content="1" />
      </li>
      ›
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemscope itemtype="https://schema.org/WebPage"
           itemprop="item" itemid="https://example.com/books/sciencefiction"
           href="https://example.com/books/sciencefiction">
          <span itemprop="name">Science Fiction</span></a>
        <meta itemprop="position" content="2" />
      </li>
      ›
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemprop="item" href="https://example.com/books/sciencefiction/awardwinners">
          <span itemprop="name">Award Winners</span></a>
        <meta itemprop="position" content="3" />
      </li>
    </ol>
    <ol itemscope itemtype="https://schema.org/BreadcrumbList">
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <a itemprop="item" href="https://example.com/literature">
          <span itemprop="name">Literature</span></a>
        <meta itemprop="position" content="1" />
      </li>
      ›
      <li itemprop="itemListElement" itemscope
          itemtype="https://schema.org/ListItem">
        <span itemprop="name">Award Winners</span>
        <meta itemprop="position" content="2" />
      </li>
    </ol>
  </body>
</html>

HTML

Dưới đây là ví dụ về đoạn breadcrumb HTML trong trang, là một phần của thiết kế hình ảnh.

<html>
  <head>
    <title>Award Winners</title>
  </head>
  <body>
    <ol>
      <li>
        <a href="https://www.example.com/books">Books</a>
      </li>
      <li>
        <a href="https://www.example.com/books/sciencefiction">Science Fiction</a>
      </li>
      <li>
        Award Winners
      </li>
    </ol>
    <ol>
      <li>
        <a href="https://www.example.com/literature">Literature</a>
      </li>
      <li>
        Award Winners
      </li>
    </ol>
  </body>
</html>

Nguyên tắc

Bạn phải tuân thủ những nguyên tắc này để đủ điều kiện xuất hiện kèm theo breadcrumb trong Google Tìm kiếm.

Bạn nên cung cấp những breadcrumb thể hiện một đường dẫn điển hình mà người dùng thường đi theo để truy cập một trang thay vì tham chiếu theo cấu trúc của URL. Bạn không bắt buộc phải thêm breadcrumb ListItem cho đường dẫn cấp cao nhất (miền hoặc tên máy chủ lưu trữ của trang web) cũng như cho chính trang đó.

Định nghĩa các kiểu dữ liệu có cấu trúc

Để chỉ định breadcrumb, hãy xác định một thuộc tính BreadcrumbList có chứa ít nhất 2 ListItems. Bạn phải thêm các thuộc tính bắt buộc để nội dung của bạn đủ điều kiện xuất hiện kèm theo breadcrumb.

BreadcrumbList là mục chứa mọi thành phần trong danh sách. Bạn có thể xem định nghĩa đầy đủ về BreadcrumbList tại schema.org/BreadcrumbList. Sau đây là các thuộc tính được Google hỗ trợ:

Thuộc tính bắt buộc
itemListElement

ListItem

Một mảng (array) breadcrumb được liệt kê theo một thứ tự cụ thể. Chỉ định từng breadcrumb bằng thuộc tính ListItem. Ví dụ:

{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
  "itemListElement": [{
    "@type": "ListItem",
    "position": 1,
    "name": "Books",
    "item": "https://example.com/books"
  },{
    "@type": "ListItem",
    "position": 2,
    "name": "Authors",
    "item": "https://example.com/books/authors"
  },{
    "@type": "ListItem",
    "position": 3,
    "name": "Ann Leckie",
    "item": "https://example.com/books/authors/annleckie"
  }]
}

ListItem

ListItem chứa thông tin chi tiết về một mục riêng lẻ trong danh sách. Bạn có thể xem định nghĩa đầy đủ về ListItem tại schema.org/ListItem. Sau đây là các thuộc tính được Google hỗ trợ:

Thuộc tính bắt buộc
item

URL hoặc loại phụ của Thing

URL đến trang web đại diện cho breadcrumb. Có hai cách để chỉ định item:

  • URL: Chỉ định URL của trang. Ví dụ:
    "item": "https://example.com/books"
  • Thing: Sử dụng mã nhận dạng để chỉ định URL dựa trên định dạng mã đánh dấu bạn đang sử dụng:
    • JSON-LD: Sử dụng @id để chỉ định URL.
    • Vi dữ liệu: Bạn có thể sử dụng href hoặc itemid để chỉ định URL.
    • RDFa: Bạn có thể sử dụng about, href hoặc resource để chỉ định URL.

Nếu breadcrumb là mục cuối cùng trong đường dẫn breadcrumb, thì bạn không cần phải chỉ định item. Nếu item không được sử dụng cho mục cuối cùng, Google sẽ sử dụng URL của trang chứa.

name

Text

Tiêu đề của breadcrumb hiển thị cho người dùng. Nếu đang sử dụng Thing với name thay vì URL để chỉ định item, thì bạn không cần phải chỉ định name.

position

Integer

Vị trí của breadcrumb trong đường dẫn breadcrumb. Vị trí 1 biểu thị điểm bắt đầu của đường dẫn.

使用 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 自动提取这些结果。

Khắc phục sự cố

Nếu gặp sự cố khi triển khai hoặc gỡ lỗi dữ liệu có cấu trúc, thì bạn có thể tham khảo một số tài nguyên trợ giúp sau đây.