1

Schema.org’s ImageObject example uses itemprop="contentUrl".

I tested this simplified code in Google: https://search.google.com/structured-data/testing-tool gives me an error:

A value for the url field is required

<div itemscope itemtype="http://schema.org/Article">    
<div itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
    <img itemprop="contentUrl" src="1.png" alt="alt of the image">
    <p itemprop="caption">Caption of the image</p>
</div>
<h1 itemprop="name">Title of the post</h1>
<div itemprop="articleBody" class="text">       
    <p>This is the body of the post</p>
</div>
</div>

How to solve that error in Google?

0

You can provide the url property in addition to the contentUrl property:

<img itemprop="contentUrl url" src="1.png" alt="alt of the image">

(Ideally Google would use/require contentUrl instead of url for the image for their Article rich result.)

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.