【问题标题】:Structured markup data of website name网站名称的结构化标记数据
【发布时间】:2015-07-24 10:45:31
【问题描述】:

根据Google,您应该添加标记数据以便在搜索结果中包含您的站点名称:

在他们的微数据使用示例中,他们将网站名称附加到页面title

   <head itemscope itemtype="http://schema.org/WebSite">
   <title itemprop='name'>Your WebSite Name</title>
   <link rel="canonical" href="https://example.com/" itemprop="url">

但显然页面标题与网站名称不一样!
我在这里错过了什么?

【问题讨论】:

    标签: html schema.org google-search-console microdata google-rich-snippets


    【解决方案1】:

    微数据可以使用on any HTML5 element(而some elements come with special rules),所以你没有使用title元素。

    如果您想将标记保留在 head 中,或者如果您没有将网站名称作为主页上的可见内容,您可以使用 meta 元素:

    <head itemscope itemtype="http://schema.org/WebSite">
      <title>Welcome to Foobar!</title>
      <meta itemprop="name" content="Foobar" />
      <link itemprop="url" href="https://example.com/" />
    </head>
    

    但是,如果您将站点名称作为可见内容,例如在页眉中,则可以使用它:

    <header itemscope itemtype="http://schema.org/WebSite">
      <h1 itemprop="name"><a itemprop="url" href="https://example.com/">Foobar</a></h1>
    </header>
    

    【讨论】:

    • 谢谢。为什么 Google 在他们的示例中使用标题标签?我看不出任何情况下这是有意义的
    • @RonenTeva:许多网站只使用主页中的站点名称title,例如stackoverflow.com(标题:“Stack Overflow”)或google.com(标题:“Google”)。一个常见的结构是 [site-name] 用于主页,[page-name] [delimiter] [site-name] 用于所有其他页面。
    • 哦,我应该只在主页上设置它而不是在每个页面上?
    • @RonenTeva:您可以在每个页面上使用WebSite(毕竟,站点名称并不是这种类型唯一有用的东西,Google 也不是它的唯一消费者),但是Google 只会在网站主页上查找 Site Name 标记:“在您的官方网站主页上发布标记”
    • 这就是我所缺少的 :) 谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-02
    • 2015-01-05
    • 1970-01-01
    • 2017-09-02
    • 2018-10-27
    • 1970-01-01
    • 2022-06-29
    相关资源
    最近更新 更多