What is the best way to represent closed days (holidays) using Schema.org vocabulary?
At this point in time there's no property in Schema.org that would allow a business to directly communicate holiday periods (e.g., Christmas) to Google bots and other web crawlers. There seems to be an open issue on Schema.org's GitHub repository however there's no telling when or if something will get added.
I have seen two solutions to this issue so far:
Use
openingHoursSpecification
withoutopens
andcloses
properties.<p property="openingHoursSpecification" typeof="OpeningHoursSpecification">
Closed between <time datetime="2015-12-24" property="validFrom">24th of December</time> and <time datetime="2015-12-26" property="validThrough">26th of December</time>.
</p>This seems like a nice solution but do we have any evidence that Google bots will properly understand this? It seems to validate in Google's Structured Data Testing Tool but does that mean that
opens
andclosed
properties are not required by Google?Use
openingHoursSpecification
with equalopens
andcloses
properties.<p property="openingHoursSpecification" typeof="OpeningHoursSpecification">
Closed between <time datetime="2015-12-24" property="validFrom">24th of December</time> and <time datetime="2015-12-26" property="validThrough">26th of December</time>.
<meta content="00:00:00" property="opens" />
<meta content="00:00:00" property="closes" />
</p>Again a nice solution but there seems to be little to no evidence of web crawlers correctly understanding this and not treating this as incorrect markup. Also it seems a bit illogical to have to specify that a business is open for zero seconds.
The only other solution I can think of to use openingHoursSpecification
with validFrom
and validThrough
properties to specify all time frames seperatly (even when the default opening hours are valid).
<div property="openingHoursSpecification" typeof="OpeningHoursSpecification">
<meta content="10:00:00" property="opens" />
<meta content="18:00:00" property="closes" />
<meta content="2015-12-23" property="validThrough" />
</div>
<p>
Closed between <time datetime="2015-12-24">24th of December</time> and <time datetime="2015-12-26">26th of December</time>.
</p>
<div property="openingHoursSpecification" typeof="OpeningHoursSpecification">
<meta content="10:00:00" property="opens" />
<meta content="18:00:00" property="closes" />
<meta content="2015-12-27" property="validFrom" />
</div>
Of course this solution is also flawed:
It requires potentially a lot of duplicate markup.
It relies heavily on using "invisible"
meta
elements instead of marking up visible data which is what Google recommends.
So which one of these solutions is best/least incorrect? Is there a better solution?
As you said there is an open issue on schema.org for this, so you may be better attempting your own solutions and using trial-and-error to see if google picks it up correct. I would use solution 2. because it gives closed hours and seems clearest, this sounded similar to the suggested solution from the schema.org thread https://github.com/schemaorg/schemaorg/issues/240#issuecomment-95458846
The aren't an issue - machine readable dates are one of the exceptions when considering use of Non-visible and machine-radable data, according to google's policies this can include dates, prices, currencies, etc.
Although the official documentation from google states it may take months to pick up changes, I've found Fetch-As-Google and a 2-3 day wait at the most works for both microdata and JSON-LD, eg in the long list of comments on a schema.org microdata question you can see the original poster tries several different changes a few days apart with 3 days between the last change and google picking it up.
I would prefer this solution, because it avoids any redundance, is clear and valid:
<div itemscope itemtype="http://schema.org/Store">
<h1 itemprop="name">Middle of Nowhere Foods</h1>
<h2>Opening hours</h2>
<p>Normally open <time itemprop="openingHours" datetime="Mo,Tu,We,Th,Fr,Sa,Su 09:00-14:00">daily 9am-2pm</time> except on:</p>
<ul>
<li itemprop="openingHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<span itemprop="validFrom" content="2013-12-24">24 December 2013</span> and
<span itemprop="validThrough" content="2013-12-25">25 December 2013</span>:
<span itemprop="opens" content="09:00">9am</span>-<span itemprop="closes" content="11:00">11am</span></li>
<li itemprop="openingHoursSpecification" itemscope itemtype="http://schema.org/OpeningHoursSpecification">
<span itemprop="validFrom" content="2014-01-01">1st January 2014</span>
<span itemprop="validThrough" content="2014-01-01"></span>:
<span itemprop="opens" content="12:00">Noon</span>-<span itemprop="closes" content="14:00">2pm</span></li>
</ul>
</div>
Comments
Post a Comment