2

I was reading all posts around this topic here but couldn't find a solution.

I'm building a page for a business that has the following opening hours:

Monday-Friday 07:00 - 12:00 and 13:00 - 17:00 (1 hour lunch break)

I can't find a way to write this as valid JSON-LD for my schema.org markup. Google's rich results test tool is not accepting my ideas and on schema.org documentation I cannot find any examples for a case like that.

The standard valid code without the lunch break looks like this:

"openingHoursSpecification": {
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday"
    ],
    "opens": "07:00",
    "closes": "17:00"
  },

The code that I would like to have there is something like this, but I can't validate it and I can't find any examples that show how it's done.

"openingHoursSpecification": {
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday"
    ],
    "opens": "07:00",
    "closes": "12:00",
    "opens": "13:00",
    "closes": "17:00"
  },
1

2 Answers 2

0

Schema has the property specialOpeningHoursSpecification that:

The special opening hours of a certain place. Use this to explicitly override general opening hours brought in scope by openingHoursSpecification or openingHours.

My suggestion for markup for your lunch:

<script type="application/ld+json">
  {
"@context":"https://schema.org",
  "@type":"Restaurant",
    "name":"GreatFood",
      "openingHoursSpecification":{
        "@type":"OpeningHoursSpecification",
          "dayOfWeek":[
            "Monday",
            "Tuesday",
            "Wednesday",
            "Thursday",
            "Friday"
          ],
            "opens":"07:00",
              "closes":"17:00"
      },
        "specialOpeningHoursSpecification":{
          "@type":"OpeningHoursSpecification",
            "dayOfWeek":[
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday"
            ],
              "closes": "12:00",
                "opens": "13:00"
        }
  }
</script>

I have not been able to find official examples for this property. I am confused by the following saying in the documentation about type OpeningHoursSpecification:

If the value for the closes property is less than the value for the opens property then the hour range is assumed to span over the next day.

The documentation of Schema does not explicitly indicate how this is accounted for the property openingHoursSpecification. Therefore, I do not know how it will be understood by search engines. Perhaps the best solution is to create an experiment and analyze the result.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the idea! That's technically valid and as you point out it must be done as an experiment to see how search engine understands this. I'll just try it. I find it odd though that the standard openingHoursSpecification has no official option for segmented opening hours... In my view that's a pretty standard case for smaller businesses in smaller cities... But maybe that's more of a European thing and in the US businesses never have lunch breaks? :)
0

The solution using hoursAvailable in these older posts seems to be working. Tested with Google's testing tool:

Original Post: Including "siesta" in Schema.org OpeningHoursSpecification in JSON-LD

Code from the original post:

{
    "@context": "http://schema.org",
    "@type": "Service",
    "url": "http://www.example.com/",
    "hoursAvailable": [{
        "@type": "OpeningHoursSpecification",
        "opens": "08:00",
        "closes": "13:00",
        "dayOfWeek": [{
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Monday",
            "name": "Monday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Tuesday",
            "name": "Tuesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Wednesday",
            "name": "Wednesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Thursday",
            "name": "Thursday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Friday",
            "name": "Friday"
        }]
    },
    {
        "@type": "OpeningHoursSpecification",
        "opens": "15:00",
        "closes": "20:00",
        "dayOfWeek": [{
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Monday",
            "name": "Monday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Tuesday",
            "name": "Tuesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Wednesday",
            "name": "Wednesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Thursday",
            "name": "Thursday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Friday",
            "name": "Friday"
        }]
    }]
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.