BlogPosting Publisher Logo 'logo.itemtype has an invalid value' on Google Structured Data Testing Tool
Solution 1
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>
Solution 2
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
The logo should be a rectangle, not a square.
The logo should fit in a
60x600px
rectangle., and either be exactly60px
high (preferred), or exactly600px
wide. (For example,450x45px
would not be acceptable, even though it fits in the600x60px
rectangle.)
Related videos on Youtube
Arth
Updated on September 18, 2022Comments
-
Arth over 1 year
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 thelogo
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?
-
Admin over 7 yearsYou should avoid using
itemprop
on the same line as aitemtype
, 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. -
Admin over 7 years@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.
-
Admin over 7 years@SimonHayter Also https://schema.org/WebPage and the whole site is riddled with examples doing exactly that..
itemprop
on the same line asitemtype
. -
Admin over 7 yearsBlonde moment, I'll totally wrong. I'll take a look in a later and get back to you :)
-