Google结构数据面包屑标记

时间:2016-08-01 02:17:25

标签: html google-webmaster-tools structured-data

我正在尝试为Google Structure Data实施面包屑,以下是我要构建的内容。

主页>分类>页面名称

问题从我的经理建议语法开始。

这是我的经理建议的。

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href="https://www.example.com" itemprop="url">
    <span itemprop="title">Home</span>
  </a> >
</div>  

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href=" https://www.example.com/blog" itemprop="url">
    <span itemprop="title">Category</span>
  </a> >
</div>  

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <a href=" https://www.example.com/blog/can-work-pregnant/" itemprop="url">
    <span itemprop="title">Page Name</span></a>
</div>  

这是我认为是正确的。

<div itemscope itemtype="http://schema.org/BreadcrumbList">
  <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/">
        <span itemprop="name">Home</span></a>
        <meta itemprop="position" content="1" />
  </span>
  <span class="seperator">></span>
  <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/category">
      <span itemprop="name">Category</span></a>
      <meta itemprop="position" content="2" />
      </span>
      <span class="seperator">›</span>
    <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
    <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="https://example.com/category/page">
      <span itemprop="name">Page Name</span></a>
      <meta itemprop="position" content="3" />
  </span>
</div>

如果您尝试这两种语法,您可以看到第一个创建3个单独的面包屑而不是其中包含完整数据的面包屑。

但由于这是我的经理所建议的,除非我有充分理由这样做,否则我不想拒绝它。

所以,我想知道的是使用第一种语法的优点和缺点。请帮我。提前致谢。

1 个答案:

答案 0 :(得分:0)

你的方法是正确的。它产生一个3级的面包屑痕迹。你的经理不对。他们的方式只有一个级别的3个不同的“小径”。如果只有一个项目,那就不是一个小道。enter image description here

相关问题