Das Folgende durchläuft das Google Structured Data Testing Tool wie erwartet:
<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>
Aber wenn ich versuche, ein BlogPosting
zu verwenden, bricht es die logo
-Eigenschaft:
<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>
Mit dem Fehler:
https://example.com/images/logo.png
(Das Attribut logo.itemtype hat einen ungültigen Wert.)
Kann mir jemand erklären warum? Und welche Schritte könnte ich unternehmen, um das Problem zu beheben?
Es stellt sich heraus, dass BlogPosting
einer der von Google als mögliches Rich Snippet unterstützten Typen ist und daher mehr Validierung benötigt:
Richtlinien zur Dokumentation der Google-Suche für Artikel
Dies setzt voraus, dass das logo
des Herausgebers eines Artikels vom Typ ImageObject
ist und width
und height
in Pixel aufweist. BlogPosting
ist ein Untertyp von Article
.
Dieses aktualisierte Snippet wird mit dem Google Structured Data Testing Tool überprüft:
<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>
Eine brillante und hilfreiche Antwort von @Arth oben.
Um die obige Antwort zu vervollständigen (nicht mit ihr zu konkurrieren), sind hier die gleichen strukturierten Daten unter Verwendung des gleichen schema.org Wortschatz, aber diesmal 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. Laut https://developers.google.com/search/docs/data-types/articles
Das Logo sollte ein Rechteck sein, kein Quadrat.
Das Logo sollte in ein
60x600px
Rechteck passen und entweder genau60px
hoch (bevorzugt) oder genau600px
breit sein. (Zum Beispiel wäre450x45px
nicht akzeptabel, obwohl es in das600x60px
-Rechteck passt.)