How to add schema.org structured data for AI search

Updated

What schema.org JSON-LD is, which types small businesses should add, a copy-paste example, where to put it in the HTML, and how to validate it.

Structured data is a standardized way to label the facts already on a page: the business name, the address, the product, the price, the author. AI tools can read your sentences, but a sentence can be ambiguous. Is "$19" your price, an example, or someone else's? Structured data states which fact is which.

What JSON-LD is

JSON-LD (JSON for Linked Data) writes those facts as JSON inside a <script type="application/ld+json"> tag. The vocabulary for this markup is schema.org. The same vocabulary can be written as Microdata or RDFa attributes in the HTML. Google's introduction to structured data recommends JSON-LD when your setup allows it, because the data sits beside the visible text instead of being woven through the tags, and because it is easier to keep valid.

Which types matter for a small business

Use the most specific type that is true, on the page that shows those facts. Google's structured data guidelines say not to mark up anything a visitor cannot see. These six cover most small-business sites:

Copy-paste example

A local-business homepage. Replace every value, and delete any property you do not publish on the page.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Acme Plumbing",
  "url": "https://acme.example/",
  "telephone": "+1-555-0100",
  "image": "https://acme.example/logo.png",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "12 Main Street",
    "addressLocality": "Springfield",
    "addressRegion": "IL",
    "postalCode": "62701",
    "addressCountry": "US"
  },
  "openingHours": "Mo-Fr 08:00-17:00"
}
</script>

One page, one main type. A pricing page should describe the Product and its Offer. A guide should describe the Article. When a page genuinely contains several of these, put them in one script as an @graph array. This site's homepage does that for the organization, the report and the FAQ.

Put it in the HTML the server sends

The script has to be in the HTML response, not added later by client-side JavaScript. AI crawlers generally fetch the HTML and do not run your JavaScript (see how AI search reads JavaScript sites). Google is the exception it documents: its structured data introduction says Google can read JSON-LD that JavaScript injects into the page. A crawler that never executes JavaScript cannot.

Place the tag in the <head> or at the end of <body>, in the server-rendered or static template. Then confirm it is really in the response:

curl -s https://yoursite.com | grep ld+json

If that prints nothing, the JSON-LD is not in the initial HTML.

How to validate it

What it does and doesn't do

Structured data helps a machine copy a fact instead of guessing it: which string is the business name, which number is the price, who wrote the article. It does not guarantee that ChatGPT, Claude, Perplexity or Google will cite you. Google's guidelines say the same about its own search results: correct markup does not guarantee that the structured data will be shown, even when the Rich Results Test reports no errors. The page still has to be allowed in robots.txt and readable as HTML. How to make your website visible to ChatGPT covers those steps.

BotVisible's free scan checks whether the raw HTML includes schema.org JSON-LD for an organization and for a product, service or article.

Check your site in 10 seconds

BotVisible fetches your page like an AI crawler and scores it from 0 to 100. Free, no signup.

Run a free scan

More guides