How to add structured data (JSON-LD) to your website
When we scanned 113 local business websites to see how well AI could understand and recommend them, one thing predicted the score better than anything else: structured data. In every industry, the sites missing it landed at the bottom. Here is what it is and how to add it, in plain English.
What structured data actually is
Structured data (also called schema markup or JSON-LD) is a small, hidden block of code you put on your page that spells out your facts in a format machines read directly: your business name, what you do, where you are, your hours, your phone, your reviews. A human never sees it. But when Google's AI, ChatGPT's browsing, or Perplexity reads your site, that block hands them your facts as facts, instead of making them guess from your page copy.
That is the whole game. Without it, an AI has to infer who you are from paragraphs and images, and it often gets it wrong or gives up. With it, the model can state your name, services, and area confidently, which is exactly what it needs before it will recommend you.
Why it matters more now. Being in Google's index was the old bar. As customers shift to asking AI "who's the best [business] near me," the new bar is being a business the model can describe with confidence. Structured data is the cleanest way to give it that confidence.
A copy-paste example for a local business
Here is a real LocalBusiness schema block. Replace the values with your own, keep the structure, and it will validate. This alone covers most of what an AI needs to identify and place you.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Your Business Name",
"description": "One clear sentence on what you do and who you serve.",
"url": "https://yourwebsite.com",
"telephone": "+1-555-123-4567",
"priceRange": "$$",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main St",
"addressLocality": "Austin",
"addressRegion": "TX",
"postalCode": "78701",
"addressCountry": "US"
},
"areaServed": ["Austin", "Round Rock", "Cedar Park"],
"openingHoursSpecification": [{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday","Tuesday","Wednesday","Thursday","Friday"],
"opens": "09:00",
"closes": "17:00"
}],
"sameAs": [
"https://www.facebook.com/yourbusiness",
"https://www.instagram.com/yourbusiness"
]
}
</script>
If you have reviews, add an aggregateRating. If you list services, use a more specific type than LocalBusiness where one exists (for example Dentist, Plumber, HVACBusiness, HairSalon, Attorney). More specific is better, because it tells the model exactly what category you belong to.
Where to put it
Paste the whole <script type="application/ld+json"> block into the <head> of your homepage (and ideally your contact or about page too). It does not matter visually, it is invisible to visitors. By platform:
- WordPress: use a plugin like a header-scripts inserter, or an SEO plugin (Rank Math, Yoast) which can generate LocalBusiness schema from a form.
- Wix / Squarespace: add it via the custom-code / header injection setting in site settings.
- Shopify: add it to your theme's
theme.liquidinside the<head>. - Custom / coded site: paste it directly into your HTML
<head>.
How to check it worked
- Run your URL through Google's Rich Results Test (search "Google Rich Results Test") to confirm the JSON-LD is valid.
- Then run it through an AI visibility scan to see whether the structured data actually moved how well an AI can understand and recommend you, and what gaps remain.
The honest catch: schema is necessary but not sufficient. In our study, some sites had it and still only reached a B, because they were missing the human-readable specifics an AI also needs: pricing signals, hours in text, service area, and plain answers to common questions. Schema is the floor. Clear readable content is the rest. Gyms were the clearest example: all had schema, none reached an A.
If you'd rather not touch code
Adding schema by hand is doable, but it is fiddly to get right and easy to leave incomplete. Our free scan will tell you exactly what your site is missing. If you want it handled, the Fix Pack generates ready-to-paste JSON-LD, meta and FAQ built from your real business, and Done-For-You implements everything on your site and re-scans to prove your score went up.
Get your AI-visibility score →Related: the 113-business study, why ChatGPT doesn't recommend your business, and how to show up in AI search.