BlueMark
BlueMark

Reputation: 962

schema.org product availability tags markup

Which one is correct?

<link itemprop="availability" href="http://schema.org/InStock">
​<meta itemprop="availability" content="InStock" />
<span itemprop="availability" content="in_stock"></span>

I checked official schema documentation and in examples found all of them.

I suppose all of them will work, but at the moment, is there any preferred standard?

Upvotes: 7

Views: 8260

Answers (2)

unor
unor

Reputation: 96587

Using span with the content attribute is invalid. Neither HTML5 nor Microdata allow the content attribute for span.

Using meta is invalid. HTML5 and Microdata require that meta must not be used for URI values.

Using link is correct. It’s also used in Schema.org’s enumeration guide. If some examples use meta instead, we may expect these to be fixed.

Upvotes: 9

Nelu
Nelu

Reputation: 18710

<link itemprop="availability" href="http://schema.org/InStock">

is probably best since it most closely adheres to the Enumeration that is https://schema.org/ItemAvailability.

I wouldn't use the 3rd example (<span itemprop="availability" content="in_stock"></span>) because in_stock may not map exactly to the values listed.

Upvotes: 2

Related Questions