SDTT: "A value for the image field is required"

Flo picture Flo · Jul 3, 2017 · Viewed 7.4k times · Source

I have this snippet in a LocalBusiness listing (based on this example):

<div itemscope itemtype="http://schema.org/LocalBusiness">
    <div itemprop="image" itemscope="" itemtype="http://schema.org/ImageObject">
        <img itemprop="contentUrl" src="/images/trouwlocatiefotos/medium/315_24_83_Veranda-005.jpg">
    </div>
</div>  

But Google's structured data testing tool throws an error:

image
A value for the image field is required.

Why is it throwing the error?

Testing the URL directly: https://search.google.com/structured-data/testing-tool#url=https%3A%2F%2Fwww.wonderweddings.com%2Fweddingvenues%2F315%2Fbeachclub-sunrise

Answer

unor picture unor · Jul 3, 2017

The markup snippet you posted doesn’t give the quoted error. So your actual markup is probably doing things differently.

It seems that your image property isn’t nested under the LocalBusiness item:

  • Line 396: <div itemscope itemtype="http://schema.org/LocalBusiness">
  • Line 372: <div itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
  • No itemref involved.

So your LocalBusiness item really doesn’t have an image property. Instead, the image property seems to be specified without any parent item (= itemscope), which is invalid.

Google’s SDTT probably ignores this error and parses the ImageObject as a top-level item, which is why it’s listed on its own (next to LocalBusiness and BreadcrumbList).

How to fix this?

If you can’t move the elements to nest them (like in your example snippet), you could make use of Microdata’s itemref attribute:

<div itemscope itemtype="http://schema.org/LocalBusiness" itemref="business-image"></div>
<div itemprop='image' itemscope itemtype='http://schema.org/ImageObject' id="business-image"></div>