4

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:

  1. Use openingHoursSpecification without opens and closes 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 and closed properties are not required by Google?

  2. Use openingHoursSpecification with equal opens and closes 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:

  1. It requires potentially a lot of duplicate markup.

  2. 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?

  • Do you have a specific Google Rich Snippet (or similar feature) in mind? I can’t find any where they claim to support opening hours at all. – unor Sep 17 '15 at 15:11
  • I was under the impression that Rich Snippets supported opening hours for businesses. I see it all the time when searching for specific businesses. And Google has examples of using opening hours on its Google Developers website: developers.google.com/webmasters/business-location-pages/… – user55970 Sep 17 '15 at 19:53
  • Interesting, thanks. I wonder why they don’t put this (also) into their Structured Data section. And unfortunately they don’t document which properties are supported, they merely give some examples :/ – unor Sep 17 '15 at 20:06
1

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.

-1

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>
  • 1
    With all due respect this answer doesn't at all address the problem posed in the question. I know I can use openingHoursSpecification to communicate alternative hours when the business is open. What I want to do as well is specify dates when the business is closed for the whole day regardless of the regular opening hours. Many businesses have holiday periods so I was surprised to see that this was not addressed in Schema.org vocabulary or for that matter in the GoodRelations vocabulary from which OpeningHoursSpecification comes from. – user55970 Sep 18 '15 at 10:08
  • @ST17 The bottlenecks are that Schema.org-format doesn't allow setting of datetime durations, like they are described here: w3schools.com/schema/schema_dtypes_date.asp, under Duration Data Type. And there isn't a Schema.org property like "closed". So one is forced to use opens=00:00 closes=00:00 – Evgeniy Sep 18 '15 at 12:03
  • Note that this is not valid HTML5+Microdata, as the time element’s datetime attribute may not contain a value like "Mo,Tu,We,Th,Fr,Sa,Su 09:00-14:00", and the span element may not have a content attribute. – unor Sep 23 '15 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy