2

Can I use itemprop image directly?:

<article itemscope itemtype="http://schema.org/Article">
<img  itemprop="image" src="1.png">
<h1 itemprop="headline name" >Title of the post</h1>
<div>2016-01-07</div>           
<p itemprop="articleBody">This is the body of the post</p>
</article>

Or should I embed inside ImageObject?

<article itemscope itemtype="http://schema.org/Article">
<div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <img itemprop="contentUrl url" src="1.png" alt="alt of the image">
</div>
<h1 itemprop="headline name" >Title of the post</h1>
<div>2016-01-07</div>           
<p itemprop="articleBody">This is the body of the post</p>
</article>

When I use the Google tool (www.google.com/webmasters/markup-helper/) it gives me the first option.

But then the testing tool gives me an error:

The attribute image.itemtype has an invalid value

1

From the perspective of Schema.org, both ways are fine, as the image property expects an ImageObject value (your second example) or a URL value (your first example).

As always, a specific consumer might support only one of these two ways.

For many of Google’s rich results, an ImageObject is required, because Google wants to see more data about the image, which is not possible when providing just a URL. For example, their Articles rich result requires the height/width properties for the ImageObject value.

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.