structured data·3 min read
Structured data for AI: a beginner's guide to JSON-LD
What JSON-LD is, why AI needs it, and how to add it to your site.
When AI reads your website, it sees text. But it doesn't automatically know whether that text describes a restaurant, a law firm, or a SaaS product. Structured data solves this - it gives AI typed, labelled information in a format machines can parse instantly.
What is JSON-LD?
JSON-LD (JSON for Linked Data) is structured data embedded in a <script> tag in your page's <head>. It uses the Schema.org vocabulary and is invisible to visitors.
A simple example for a local business:
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Sunrise Bakery",
"url": "https://sunrise-bakery.example.com",
"description": "Artisan bakery and cafe in downtown Portland.",
"address": {
"@type": "PostalAddress",
"streetAddress": "742 Evergreen Terrace",
"addressLocality": "Portland",
"addressRegion": "OR",
"postalCode": "97201"
},
"telephone": "+1-503-555-0199"
}
Without this, AI has to guess what your business is. With it, AI knows instantly.
Why AI needs it
AI uses structured data to:
- Classify your business - restaurant, dentist, or software company?
- Extract key facts - address, hours, pricing, products
- Compare you to competitors - structured data makes ranking straightforward
- Generate accurate answers - direct answers instead of guesses
If your competitor has structured data and you don't, AI recommends them because it can confidently describe what they offer.
Which type to use
| Business type | Schema type |
|---------------|-------------|
| Local shop / restaurant | LocalBusiness or subtype like Restaurant |
| Service company | ProfessionalService |
| Online store | Organization + Product |
| SaaS / software | SoftwareApplication or Organization |
| Freelancer | Person or ProfessionalService |
| Blog / content site | WebSite + Article |
Full list at schema.org/docs/full.html. Always pick the most specific type.
How to add it
WordPress
Install Yoast SEO or Rank Math - both generate structured data automatically. For custom JSON-LD, use WPCode to insert a script into your <head>.
Shopify
Edit theme.liquid and paste the JSON-LD script inside <head>. Check if your theme already includes basic structured data first.
Wix
Settings > Custom Code > Head, paste your script.
Squarespace
Settings > Advanced > Code Injection > Header.
Custom / static site
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Your Company",
"url": "https://yoursite.com",
"description": "What your company does."
}
</script>
Common mistakes
Wrong type. Don't use WebSite when LocalBusiness is more accurate.
Invented data. Only include information that exists on your site.
Too many nodes. Your homepage needs one Organization/Business node and optionally a WebSite node. Don't list every product or blog post.
No validation. Use Google's Rich Results Test to check your markup.
Check yours
Right-click your homepage, View Page Source, search for application/ld+json. Nothing? You don't have any.
Or run a free AI Readiness Audit - we check structured data along with five other signals.
Check your site's AI readiness
Run a free audit to see how visible your website is to AI agents. Takes about 5 seconds.