Google结构化数据测试工具上的BlogPosting Publisher徽标“ logo.itemtype具有无效值”


13

预期会通过Google结构化数据测试工具执行以下操作:

<div>
    <div itemprop="publisher" itemscope id="organization-example" itemtype="https://schema.org/Organization">
        <a itemprop="url" href="https://example.com">
            <img itemprop="image logo" src="https://example.com/images/logo.png" alt="LOGO">
            <span itemprop="name">EXAMPLE</span>
            <span itemprop="description">This is an EXAMPLE</span>
        </a>
    </div>
</div>

<div itemscope itemtype="https://schema.org/WebPage" itemref="organization-example">
</div>

但是当我尝试使用a时BlogPosting会破坏logo属性:

<div>
    <div itemprop="publisher" itemscope id="organization-example" itemtype="https://schema.org/Organization">
        <a itemprop="url" href="https://example.com">
            <img itemprop="image logo" src="https://example.com/images/logo.png" alt="LOGO">
            <span itemprop="name">EXAMPLE</span>
            <span itemprop="description">This is an EXAMPLE</span>
        </a>
    </div>
</div>

<article
    itemscope
    itemtype="https://schema.org/BlogPosting"
    itemref="organization-example"
>
</article>

与错误:

https://example.com/images/logo.png (属性logo.itemtype具有无效值。)

谁能解释为什么?我可以采取哪些步骤来修复它?


您应该避免使用itemprop与相同的行itemtype,因为发布者是Organization,WebPage和BlogPosting的子级。最好<body itemscope itemtype="https://schema.org/Organization">再用<article itemscope itemtype="https://schema.org/BlogPosting"> <span itemprop="publisher">等等。。。不需要重复多次徽标,尤其是在博客文章中。
西蒙·海特

@SimonHayter谢谢,但是Publisher不是Organization的子级,而Organization在WebPage的顶部,因此我想从BlogPosting引用它。.您是否建议使用Organization-> BlogPosting-> Publisher结构?这似乎不正确。
Arth

@SimonHayter也https://schema.org/WebPage和整个网站充满了例子做的正是这.. itemprop在同一行itemtype
Arth

金发碧眼的时刻,我完全错了。我稍后再看:)
西蒙·海特

Answers:


15

事实证明,由于BlogPosting作为可能的Rich Snippet是Google支持的一种类型,因此它们应用了更多的验证方法:

Google文章搜索文档准则

这要求文章的发布者的logo类型为,ImageObject并且具有widthheight像素。BlogPosting是的子类型Article

此更新的代码段通过Google结构化数据测试工具进行了验证:

<div id='web-page-example' itemprop="mainEntityOfPage" itemscope itemtype="https://schema.org/WebPage" itemref="headline-example">
    <div>
        <div itemprop="publisher" itemscope id="organization-example" itemtype="https://schema.org/Organization">
            <a itemprop="url" href="https://example.com">
                <span itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
                   <img itemprop="url" src="https://example.com/images/logo.png" alt="LOGO">
                   <meta itemprop="width" content="600">
                   <meta itemprop="height" content="60">
                </span>   
                <span itemprop="name">EXAMPLE</span>
                <span itemprop="description">This is an EXAMPLE</span>
            </a>
        </div>
    </div>  
    <div
        id="blog-posting-example"
        itemprop="mainEntity"
        itemscope
        itemtype="https://schema.org/BlogPosting"
        itemref="organization-example web-page-example"
    >
        <span itemprop="author" itemscope itemtype="https://schema.org/Person">
            <span itemprop="name">Example Author</span>
        </span>
        <time itemprop="datePublished" datetime="2016-05-09T11:40:04+02:00">9th May 2016</time>
        <time itemprop="dateModified" datetime="2016-05-09T11:40:04+02:00">9th May 2016</time>
        <h1 id="headline-example" itemprop="name headline">Example Headline</h1>
        <span itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
            <img itemprop="url" src="https://example.com/images/blog.png" alt="LOGO">
            <meta itemprop="width" content="800">
            <meta itemprop="height" content="400">
        </span>
    </div>
</div>  

11

上面@Arth提供的出色而有用的答案。

为了补充上面的答案(不与之竞争),这里是使用相同schema.org词汇表的相同结构化数据,但这一次是:JSON-LD

    "publisher": {
        "@type": "Organization",
        "name": "myOrganization",
        "logo": {
            "@type": "ImageObject",
            "name": "myOrganizationLogo",
            "width": "60",
            "height": "600",
            "url": "http://my-organization.org/my-logo.png"
        }
    }

注意:根据https://developers.google.com/search/docs/data-types/articles

  1. 徽标应为矩形,而不是正方形。

  2. 徽标应适合60x600px矩形。并且徽标60px高度一定要高(首选)或600px宽度一定要大。(例如, 450x45px即使它适合600x60px矩形,也不可接受 。)

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.