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?
This is everything you need to know to get started with schema markup. What is Product Schema Markup? Product schema markup is code that is embedded in your website. It is structured data of your product that publishes alongside your product in search results. Its purpose is to help search engines provide better results to users.
Getting Started - schema.org Schema.org is a set of extensible schemas that enables webmasters to embed structured data on their web pages for use by search engines and other applications. Schema.org Documentation Schemas About Note: you are viewing the development version of Schema.org. See How we workfor more details.
Extending schema.org Most sites and organizations will not have a reason to extend schema.org. However, schema.org offers the ability to specify additional properties or sub-types to existing types. If you are interested in doing this, read more about the schema.org extension mechanism.
This is why seoClarity developed its plug-in called schema.dev for Google Chrome. This plug-in allows you to create one template to deploy product schema markup across all of your product pages simultaneously. This saves you a great deal of time and money. It also reduces the occurrence of human error.
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.
<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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With