I have added Schema.org/Microdata properties to a list component on my site:
// This is one item in my list:
<div itemscope
itemtype = "http://schema.org/WebApplication"
>
<span itemprop = "name">
The Awesome Web App 01
</span>
<span
itemprop = "locationCreated"
itemscope
itemtype = "http://schema.org/City"
>
<span itemprop = "name">
Chicago
</span>
</span>
</div>
When I run that through the google Structured Data Testing Tool I get error:
Two of operatingSystem, aggregateRating, applicationCategory, offers are required.
So I have a few questions:
1 - Does it matter that I have this error
? Will the error force google to ignore everything else?
2 - Do I now have to create new visible <div>
's to hold these new fields?
3 - Of the 4 required fields, only one, applicationCategory
, is relevant to my situation ... the others are not ... so why should I have to use them?
UPDATE: I would like to use the Microdata format rather that the JSON-LD format (or RDFa). See a comparison of formats here.
1 - yes and yes.
2 - no, see below.
3 - OK, just add the operatingSystem, per below. If you support 2+ operatingSystem, make it an array (JSON-LD) or inlude another <span></span>
.
The following is valid and will be parsed properly by Google:
<div itemscope
itemtype = "http://schema.org/WebApplication"
>
<span itemprop = "name">
The Awesome Web App 01
</span>
<span
itemprop = "locationCreated"
itemscope
itemtype = "http://schema.org/City"
>
<span itemprop = "name">
Chicago
</span>
</span>
<span itemprop = "operatingSystem">
Android
</span>
<span itemprop = "applicationCategory">
Games
</span>
</div>
If you want to hide the value of an element, use this approach:
<span>
<meta itemprop = "operatingSystem" content="Android"/>
</span>
You don’t have to provide these properties. The vocabulary Schema.org does not define any required properties.
If Google’s Structured Data Testing Tool says that a property is required, it only means that this property is required for getting one of Google’s search result features (e.g., a Rich Snippet).
If you don’t provide the properties, Google will (likely) not display that search result feature. Nothing else happens. It’s perfectly fine/normal not to provide all properties the SDTT would like to see.
If you could provide the properties, but you don’t want to have them visible on your page, you can use the link
element (if the value is a URI) or the meta
element (for all other values). For Microdata these elements may be added to the body
, and they are hidden by default.
来源:https://stackoverflow.com/questions/37485727/do-i-have-to-create-new-visible-elements-to-abide-by-googles-microdata-schema-o