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> 
+5
html5 meta microdata
03 Sep '11 at 13:25
source share
6 answers

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> 
+9
Sep 09 '11 at 8:37
source share

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 
+3
Aug 01 '13 at 3:51
source share

While it is allowed to use meta (if used for Microdata!) In the body , your example is incorrect for several reasons:

  • The dl element can only contain dt or dd elements (and script / template ). You need to place meta inside dt / dd or outside dl (but then you have to move itemscope ).

  • The meta element must have a content attribute.

  • Using itemid for this purpose is wrong, and http://schema.org/ItemAvailability not a type, so using itemscope + itemtype also wrong.

  • However, if itemprop is a URI, you should use the link element instead of the meta element.

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> 
+1
Jul 26 '16 at 17:40
source share

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:

enter image description here

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.

0
Sep 03 2018-11-11T00:
source share

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>

0
Jan 23 '14 at 11:25
source share

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?

-2
Feb 06 '13 at 13:11
source share



All Articles