Local Business schema or structured data is a way to provide search engines like Google with more detailed information about your business, such as its name, address, phone number, hours of operation, and more. Adding structured data to your website can help improve your search engine visibility and make it easier for potential customers to find you online.
How to add Local Business (LocalBusiness) Schema / Structured Data to your WordPress site?
You can add JSON-LD structured data by hooking into the wp_head
action, like so:
<?php
add_action( 'wp_head', 'wpsnippets_local_business_structured_data' );
function wpsnippets_local_business_structured_data() {
?>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Restaurant",
...
}
</script>
<?php
}
Simple Local Business Schema template
Replace the placeholder values in code below with your business information, and add it to your website’s HTML where you want the Local Business schema markup to appear.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"address": {
"@type": "PostalAddress",
"addressLocality": "Mexico Beach",
"addressRegion": "FL",
"streetAddress": "3102 Highway 98"
},
"description": "A superb collection of fine gifts and clothing to accent your stay in Mexico Beach.",
"name": "Beachwalk Beachwear & Giftware",
"telephone": "850-648-4200",
"url": "https://www.example.com/restaurant-locations/manhattan",
"email": "mailto:jane-doe@xyz.edu",
"sameAs":[
"https://www.facebook.com/profile_url",
"https://www.linkedin.com/company/profile_url/",
"https://twitter.com/profile_url",
"https://instagram.com/profile_url",
]
}
</script>
Specific types of local businesses
Here’s a list taken from schema.org/LocalBusiness that lists the “top level” specific types of Local Businesses. Make sure to check these out, because there are even more specific sub-types.
- AnimalShelter
- ArchiveOrganization
- AutomotiveBusiness
- ChildCare
- Dentist
- DryCleaningOrLaundry
- EmergencyService
- EmploymentAgency
- EntertainmentBusiness
- FinancialService
- FoodEstablishment
- GovernmentOffice
- HealthAndBeautyBusiness
- HomeAndConstructionBusiness
- InternetCafe
- LegalService
- Library
- LodgingBusiness
- MedicalBusiness
- ProfessionalService
- RadioStation
- RealEstateAgent
- RecyclingCenter
- SelfStorage
- ShoppingCenter
- SportsActivityLocation
- Store
- TelevisionStation
- TouristInformationCenter
- TravelAgency
How to add your opening hours to Local Business schema?
Opening hours can be added in a variety of ways. See an example below, or view more options in the section about Business hours in the documentation.
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "09:00",
"closes": "21:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Saturday",
"Sunday"
],
"opens": "10:00",
"closes": "23:00"
}
]
Local Business structured data for restaurants
An example taken from the documentation contains an example that is useful for restaurants:
<html>
<head>
<title>Dave's Steak House</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Restaurant",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"name": "Dave's Steak House",
"address": {
"@type": "PostalAddress",
"streetAddress": "148 W 51st St",
"addressLocality": "New York",
"addressRegion": "NY",
"postalCode": "10019",
"addressCountry": "US"
},
"review": {
"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": "4",
"bestRating": "5"
},
"author": {
"@type": "Person",
"name": "Lillian Ruiz"
}
},
"geo": {
"@type": "GeoCoordinates",
"latitude": 40.761293,
"longitude": -73.982294
},
"url": "https://www.example.com/restaurant-locations/manhattan",
"telephone": "+12122459600",
"servesCuisine": "American",
"priceRange": "$$$",
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday"
],
"opens": "11:30",
"closes": "22:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Wednesday",
"Thursday",
"Friday"
],
"opens": "11:30",
"closes": "23:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": "Saturday",
"opens": "16:00",
"closes": "23:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": "Sunday",
"opens": "16:00",
"closes": "22:00"
}
],
"menu": "https://www.example.com/menu",
"acceptsReservations": "True"
}
</script>
</head>
<body>
</body>
</html>
Make sure to test your snippet using the Rich Results testing tool!