How to add LocalBusiness schema markup to your website
A copy-and-edit JSON-LD template that tells search engines and AI assistants your name, address, phone, hours and area in a form they do not have to guess at.
What it is and what it does
Schema markup is a block of structured data, written in a format called JSON-LD, that describes your business to software: its name, address, phone number, opening hours and the area it serves. Search engines and AI assistants can read your visible page, but structured data removes the guesswork. It does not guarantee anything, and it does not replace having the same facts written on the page.
The template
Copy this, replace every value with your own, and keep the structure. The business below is made up: the number, address and web address are placeholders.
{
"@context": "https://schema.org",
"@type": "Plumber",
"@id": "https://www.example.com/#business",
"name": "Example Plumbing",
"url": "https://www.example.com/",
"telephone": "+1-555-555-0100",
"image": "https://www.example.com/images/van.jpg",
"description": "Residential plumbing repair and water heater installation.",
"address": {
"@type": "PostalAddress",
"streetAddress": "100 Example Street",
"addressLocality": "Exampleville",
"addressRegion": "WA",
"postalCode": "98000",
"addressCountry": "US"
},
"areaServed": ["Exampleville", "Sampletown"],
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "08:00",
"closes": "17:00"
}
],
"sameAs": [
"https://www.facebook.com/exampleplumbing"
]
} Pick the most specific type
The "@type" line should be the most specific one that fits. schema.org has types for most trades, including Plumber, Electrician, RoofingContractor, HVACBusiness, Restaurant, CafeOrCoffeeShop, Bakery, Dentist, HairSalon, BeautySalon and AutoRepair. If nothing fits, use LocalBusiness. Browse the list at schema.org/LocalBusiness.
Where to paste it
Wrap it in a script tag and put it in the head of every page it describes, usually your home page and contact page:
<script type="application/ld+json">
{ ...the JSON above... }
</script> - WordPress: an SEO plugin such as Yoast or Rank Math has a local business section that writes this for you. Otherwise add it with a header-code plugin.
- Wix, Squarespace and Shopify: use the site-wide custom code or header injection setting.
- A hand-built site: paste it into the head of the page.
Test it
- Paste your page address into Google's Rich Results Test, or the code into the Schema Markup Validator at validator.schema.org.
- Fix any error before worrying about warnings. A JSON-LD block with a stray comma is silently ignored, and nothing on the page looks wrong.
Mistakes that make it useless
- Markup that does not match the page. If the JSON says you open at 8 and the page says 9, you have given the machine two answers.
- Marking up reviews you wrote or collected yourself. Google's guidelines exclude a business's own reviews of itself, and invented ratings can earn a penalty. Leave aggregateRating out unless it reflects real reviews shown on the page.
- Several different business names across pages, or the wrong type. Use one "@id" for the business and reuse it.
- Forgetting to update it. When your hours change, change the JSON too.
Structured data is one of the checks in our free check. If you would rather have it done and kept current, the websites we build ship with it already written from your details; see Techne.
