How to use it
- Choose the business type and enter the name, website, phone and a photo URL.
- Fill in the address and, if you know them, the map coordinates.
- Type the opening hours in one line, for example
Mo-Fr 07:00-19:00; Sa-Su 08:00-14:00. - Copy the script and paste it into your site.
How it works
The output is an object of the chosen type with name, url, image, telephone and priceRange. The address becomes a PostalAddress (streetAddress, addressLocality, addressRegion, postalCode, addressCountry), the coordinates a GeoCoordinates. Each hours group becomes an OpeningHoursSpecification with the full English day names that schema.org uses (Monday … Sunday), opens and closes as HH:MM. A range can wrap round the week: Fr-Mo is Friday to Monday. Commas in coordinates are read as decimal points.
Example
The default hours Mo-Fr 07:00-19:00; Sa-Su 08:00-14:00 become two entries:
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "07:00",
"closes": "19:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Saturday", "Sunday"],
"opens": "08:00",
"closes": "14:00"
}
]
(In the generated code each day is on its own line.) The coordinates 39.7817 and -89.6501 become "latitude": 39.7817, "longitude": -89.6501.
Tips
- Use the same spelling of name, address and phone as on your page and map listings.
- Update the hours before holidays or seasonal changes, together with the page text.
- One location per page: for a chain, put each branch’s markup on that branch’s page.