13

The following runs through the Google Structured Data Testing Tool as expected:

<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>

But when I try using a BlogPosting it breaks the logo property:

<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>

With the error:

https://example.com/images/logo.png (The attribute logo.itemtype has an invalid value.)

Can anyone explain why? And what steps I could take to fix it?

  • You should avoid using itemprop on the same line as a itemtype, since publisher is a child of Organization, WebPage and BlogPosting. Better to use <body itemscope itemtype="https://schema.org/Organization"> then <article itemscope itemtype="https://schema.org/BlogPosting"> <span itemprop="publisher"> etc... There shouldn't be a need to repeat the logo multiple times, particularly in a blog post. – Simon Hayter Aug 17 '16 at 12:01
  • @SimonHayter Thanks, but Publisher isn't a child of Organization, and the Organization is at the top of the WebPage so I wanted to reference it from the BlogPosting.. Are you suggesting the structure Organization->BlogPosting->Publisher? This seems incorrect. – Arth Aug 17 '16 at 12:07
  • @SimonHayter Also https://schema.org/WebPage and the whole site is riddled with examples doing exactly that.. itemprop on the same line as itemtype. – Arth Aug 17 '16 at 12:11
  • Blonde moment, I'll totally wrong. I'll take a look in a later and get back to you :) – Simon Hayter Aug 17 '16 at 16:27
15

Turns out, because BlogPosting is one of the types supported by Google as a possible Rich Snippet, they apply more validation:

Google Search Documentation Guidelines for Articles

This requires an Article's Publisher's logo to be of type ImageObject and have a width and height in pixels. BlogPosting is a subtype of Article.

This updated snippet validates through the Google Structured Data Testing Tool:

<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>  
10

A brilliant and helpful answer by @Arth above.

To complement the answer above (not compete with it), here is the same Structured Data using the same schema.org vocabulary, but this time in JSON-LD:

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

N.B. According to https://developers.google.com/search/docs/data-types/articles

  1. The logo should be a rectangle, not a square.

  2. The logo should fit in a 60x600px rectangle., and either be exactly 60px high (preferred), or exactly 600px wide. (For example, 450x45px would not be acceptable, even though it fits in the 600x60px rectangle.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.