Structured data generator for a local business
Structured data tells Google, in a format that leaves no room for interpretation, what your business is called, where it is and when it opens. Fill in the form and copy the block: it goes inside the HTML of your homepage or your contact page.
Your JSON-LD block
Required details missing: the name, the street, the town.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "",
"address": {
"@type": "PostalAddress",
"streetAddress": "",
"addressLocality": "",
"addressCountry": "ES"
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "09:00",
"closes": "18:00"
},
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Saturday",
"Sunday"
],
"opens": "00:00",
"closes": "00:00"
}
]
}
</script>Paste it into the HTML of the page where these details are visible. Then test the published page.
What it is and what it is for
It is a block of text in JSON-LD format that is added to the page's code. Visitors do not see it; search engines do. It uses the schema.org vocabulary, which is the one read by Google, Bing and assistants.
Google only requires two properties for a local business: the name and the address. It also recommends phone, web address, opening hours, coordinates and price range. This generator covers the required ones and those recommended ones.
Having the block does not guarantee that Google will show anything different in the results. What it does is remove ambiguity: if your opening hours appear in three places in three formats, the block settles which one is right.
How to fill it in
Everything you enter has to match what can be read on the page and your Google Business Profile. Google's guidelines ask you not to mark up information the visitor cannot see.
- Business type: choose the most specific one that fits. If none fits, leave “Local business”.
- Phone: with country code, such as +34 910 000 000.
- Coordinates: optional. Google asks for at least five decimal places. You get them in Google Maps by right-clicking on your door.
- Opening hours: in 24-hour format. If you close at midday, turn on the second slot; it is written as two entries for the same day.
- Closed day: mark it as closed and the generator writes opening and closing at 00:00, which is how Google asks for it to be indicated.
- Profiles: the full address of Instagram, Facebook or Google Maps, one per line.
Where to paste it
The whole block, with its script tag, goes in the HTML of one page only: the homepage or the contact page, whichever has the details in view. There is no need to repeat it on every page.
In WordPress it is pasted with a “Custom HTML” block or from the theme's header code section. In builders such as Wix or Squarespace, in the page's custom code option. If someone else runs the website for you, send them the block as it is.
If your website already uses an SEO plugin that generates business data, do not paste a second block: two descriptions of the same business with different data is exactly what this was meant to avoid.
How to check it is right
Publish the page and run it through Google's Rich Results Test. It should detect a “Local businesses” item with no errors. Yellow warnings about recommended fields you have not filled in do not block anything.
Repeat the check when you change your opening hours or phone number. A block with last year's hours is worse than having no block.
Frequently asked questions
Can I put my reviews and my average rating in the block?
Not to get stars shown. Google does not show review stars when the business itself marks them up on its own website; the rating properties are intended for sites that collect reviews of other businesses. That is why the generator does not include them.
I have two premises, do I make one block or two?
One per premises, each on the page for that location, with its own address, phone and opening hours.
How do I set different hours in August or on public holidays?
The vocabulary allows it with validity start and end dates, but for special hours the practical thing is to update them in your Google Business Profile, which is what shows in Maps. This generator writes the regular hours.
Is my data sent anywhere?
No. The block is put together in your browser and the page sends nothing to any server.
The guide that explains it
Local SEO for small businesses: a practical guide and 30-day plan. How Google decides which businesses show in the map and local results, what to do on your website and beyond, and a 30-day plan.