Using the HTML5 + Microdata <meta> tag in <body>
I want to indicate whether the Product is “in stock” using the HTML5 + Microdata <meta> using Schema.org .
I am not sure if this is the correct syntax:
<div itemscope itemtype="http://schema.org/Product"> <h2 itemprop="name">Product Name</h2> <dl itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <dt itemprop="price">$1</dt> <meta itemprop="availability" itemscope itemtype="http://schema.org/ItemAvailability" itemid="http://schema.org/InStock"> </dl> </div> The meta tag cannot be used with a similar tag. The correct way to express this is through a canonical link using the link tag:
<div itemscope itemtype="http://schema.org/Product"> <h2 itemprop="name">Product Name</h2> <dl itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <dt itemprop="price">$1</dt> <link itemprop="availability" href="http://schema.org/InStock"> </dl> </div> I did the same thing as the OP, and got the same thing when the accessibility in the testing tool is related to sub ... I finally was able to get it to validate this correctly:
<meta itemprop='availability' content='http://schema.org/InStock'> Here is the result of Google’s structured tool for proposal:
Item 1 type: http://schema.org/offer property: price: Price: $139.00 pricecurrency: USD availability: http://schema.org/InStock While it is allowed to use meta (if used for Microdata!) In the body , your example is incorrect for several reasons:
The
dlelement can only containdtorddelements (andscript/template). You need to placemetainsidedt/ddor outsidedl(but then you have to moveitemscope).The
metaelement must have acontentattribute.Using
itemidfor this purpose is wrong, andhttp://schema.org/ItemAvailabilitynot a type, so usingitemscope+itemtypealso wrong.However, if
itempropis a URI, you should use thelinkelement instead of themetaelement.
In addition, the price value should not contain a currency symbol, and it seems that your dt should be dd (with a dt containing "Price" or something else).
So you can use:
<dl itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <dt>Price</dt> <dd>$<span itemprop="price">1</span> <link itemprop="availability" href="http://schema.org/InStock" /></dd> </dl> I did jsfiddle here: http://jsfiddle.net/dLryX/ , then put the output ( http://jsfiddle.net/dLryX/show/ ) into the extended snippets tool.
This came back with:

I believe that the syntax is correct and that the warning is not important because it has no property, because it is a meta tag.
See under the heading Invisible Content (not sure if this helps):
Google Webmaster Tools - About Microdata
In general, Google does not display content that is not displayed to the user. In other words, don’t show content to users in one way and use hidden text to mark up information separately for search engines and web applications. You must mark the text that is actually displayed to your users when they visit your web pages.
There are a few exceptions to this guide. In some situations, it may be useful to provide search engines with more detailed information, even if you do not want this information to be visible to visitors to your page. For example, if a restaurant has a rating of 8.5, users (but not search engines) will consider that the rating is based on a scale of 1 to 10. In this case, you can indicate this using a meta element, for example:
<div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"> Rating: <span itemprop="value">8.5</span> <meta itemprop="best" content="10" /> </div>
This is an example from the schema.org getting started guide to support @Lawrence's answer.
However, I do not like the use of the link tag inside the body of the page. From MDN :
A link tag can only occur in the head element;
Is there a better way to indicate availability using valid markup?