【问题标题】:Google complains image missing or invalid itemtype谷歌抱怨图像丢失或无效的项目类型
【发布时间】:2016-01-05 04:40:19
【问题描述】:

无论我如何标记图片,Google 都会抱怨图片丢失或包含无效的 itemtype。

<html itemscope itemtype="http://schema.org/Article">
 <head>
  ...
  <link itemprop="image" href="https://www.example.com/image.jpg" />
 </head>
 <body>
  <img itemprop="image" src="https://www.example.com/image.jpg" />
 </body>
</html>

如何在文章中添加图片?

【问题讨论】:

    标签: schema.org microdata google-rich-snippets


    【解决方案1】:

    Schema.org 的 image property 可以有一个 URL(这就是你所做的)或一个 ImageObject 作为值。

    对于Google’s Articles Rich Snippet,Google 似乎(根据他们的文档和他们的测试工具)只支持ImageObject 的变体。

    因此,如果您想获得该 Rich Snippet,您可能不得不使用类似这样的东西:

    <body itemscope itemtype="http://schema.org/Article">
    
      <div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
        <img itemprop="url" src="https://www.example.com/image.jpg" />
        <meta itemprop="height" content="20" />
        <meta itemprop="width" content="20" />
      </div>
    
    </body>
    

    【讨论】:

    • 我尝试了同样的事情,但只是将 body 替换为 html 并且谷歌仍然说图像丢失并且是必需的。
    • @user3338098:如果我复制粘贴我的 sn-p(或者如果我在我的 sn-p 中将 body 替换为 html)并测试它,则不会报告与 image 相关的错误.
    • 我们使用 angularjs,但 google 只能看到 noscript 标签内的内容,因为在 noscript 标签中模拟页面的整个主体非常昂贵,我们必须将结果缓存几天,这就是为什么google 没有看到 itemprop,因为它看到的是几天前的版本。
    • @user3338098:请注意,在这种情况下,使用 JSON-LD(而不是 Microdata 或 RDFa)可能更有意义,因为您不需要使用 HTML 作为“载体”。
    猜你喜欢
    • 2018-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多