【问题标题】:Use of SiteNavigationElement and BreadcrumbList together一起使用 SiteNavigationElement 和 BreadcrumbList
【发布时间】:2018-03-24 17:11:34
【问题描述】:

我正在开发以下对 SEO 友好的导航:

<nav itemprop="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
    <ul id="hornavmenu" class="nav navbar-nav">
        <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" >
            <a href="index.html" class="fa-home active" itemprop="item"><span itemprop="name">Start</span></a>
        </li>
        <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" >
            <a href="about.html" class="fa-group " itemprop="item"><span itemprop="name">About</span></a>
        </li>
        <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" >
            <a href="contact.html" class="fa-comment " itemprop="item"><span itemprop="name">Contact</span></a>
        </li>
    </ul>
</nav>

所以问题是,在 Google 搜索中,面包屑列表看起来像这样:
URL -> 开始 -> 关于 -> 联系方式

当然这是错误的,但代码有什么问题?另外,我想补充一点:

<nav itemscope="itemscope" itemtype="http://www.schema.org/SiteNavigationElement">
    …
</nav>

...但是我在哪里添加 BreadcrumbList 以及如何合并这两者?

【问题讨论】:

  • 您将BreadcrumbList 用于不是面包屑列表的内容,想知道为什么 Google 将其显示为面包屑列表? -- 你为什么用BreadcrumbList
  • 是的,我就是这么想的。所以我应该用 SiteNavigationElement 改变 BreadcrumbList

标签: html navigation google-search schema.org breadcrumbs


【解决方案1】:

BreadcrumbList 类型用于breadcrumbs。请勿将其用于其他用途。

在您的情况下,它似乎是一个导航菜单。 SiteNavigationElement 类型可用于这些。它可能看起来像:

<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
  <ul>
    <li><a href="index.html">Start</a></li>
    <li><a href="about.html">About</a></li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</nav>

如您所见,它适用于整个导航,而不是单个导航链接。所以don’t use name or url for the links

如果您想提供有关每个链接页面的结构化数据,您可以使用ItemList together with SiteNavigationElement。这将类似于您的 BreadcrumbList 示例。


注意:I recommend not to use SiteNavigationElement at all,除非您有特定的用例或消费者(在这种情况下,您应该遵循他们的文档)。

【讨论】:

    【解决方案2】:

    Google 不鼓励在面包屑列表中包含“主页”链接,如 Google 的 Breadcrumbs 页面所示,所有示例都省略了主页点。面包屑不适用于主要导航,您应该有足够的链接到其他地方的根目录。

    根据我使用 BreadcrumbList 的经验,当链接指向域时,Google 确实会从 SERP 中的面包屑中省略“主页”链接。在这种情况下,您使用的是“index.html”,它可能是与“example.com”不同的页面。

    SiteNavigationElement 用于指示站点的主要导航。如前所述,面包屑不是这个。使用 SiteNavigationElement 进行实际导航。详情请见What is the correct use of schema.org SiteNavigationElement?

    【讨论】:

      猜你喜欢
      • 2016-10-15
      • 2021-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 2018-07-21
      相关资源
      最近更新 更多