Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 890 forks source link

Local Seo - Opening Time - two time groups for each day -> not work correctly #18268

Open Cm-8 opened 2 years ago

Cm-8 commented 2 years ago

Please give us a description of what happened.

Hi to all, i've activated Local Seo on my site. my activity have two time groups for each day

Mon-Fry 10:00-12:00 17:00-19:00
Thu 17:00-19:00
Sat 10:00-12:00 15:00-17:00

I've set-up two time groups for each day on Opening Time on Local Seo, but into html schema markup it show:

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

Please describe what you expected to happen and why.

I expect business closing breaks to appear Monday through Friday. Like described here: https://schema.org/LocalBusiness

Used versions

Djennez commented 2 years ago

Hi @Cm-8, unfortunately, schema does not provide means to denote multiple sets of opening hours per day. So by design, we've used the opening hour of the first timeframe, and the ending time of the last timeframe.

Since this is not something we can fix, and this issue is in the wrong repository, I am closing this.

Cm-8 commented 2 years ago

Hi @Djennez Sorry if I re-issue the problem and I apologize for getting the repository wrong.

If into the json-ld example here: https://schema.org/LocalBusiness schema provide means to denote multiple sets of opening hours per day, why no use it?

  "name": "GreatFood",
  "openingHours": [
    "Mo-Sa 11:00-14:30",
    "Mo-Th 17:00-21:30",
    "Fr-Sa 17:00-22:00"
  ],

on this example, the Restaurant is open:

There is also an issue on Gitub of schema.org: How to declare 2 sets of openingHours on the same day

Djennez commented 2 years ago

@jonoalderson according to an internal issue about this same problem, this was not possible with schema, and therefore it was closed. But looking at the documentation that @Cm-8 provides, this is either added or overlooked previously. I guess we would want to implement this? Or do you know if this is actually grabbed correctly by tools like Google?

jonoalderson commented 2 years ago

It's always been technically possible with schema, but it's been unclear how Google handle and support this in the wild. I'll schedule in some time to revisit and explore later this month!

Djennez commented 2 years ago

Cool, I'll reopen the issue in the meantime.

Cm-8 commented 2 years ago

Hi to all, some news on it?

I tried adding multiple combinations of opening hours in the schema.org example and testing the code with google Rich Results Test :

Data validation went well: https://search.google.com/test/rich-results/result?id=PSfhb8_veJgCqnrrFAegvQ

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Restaurant",
  "address": {
    "@type": "PostalAddress",
    "addressLocality": "Sunnyvale",
    "addressRegion": "CA",
    "postalCode": "94086",
    "streetAddress": "1901 Lemur Ave"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4",
    "reviewCount": "250"
  },
  "name": "GreatFood",
  "openingHours": [
    "Mo-Sa 11:00-14:30",
    "Mo-Th 17:00-21:30",
    "Fr-Sa 17:00-22:00",
    "Su 7:00-11:00", 
    "Su 13:00-17:00"
  ],
  "priceRange": "$$",
  "servesCuisine": [
    "Middle Eastern",
    "Mediterranean"
  ],
  "telephone": "(408) 714-1489",
  "url": "http://www.greatfood.com"
}
</script>