# Missing structured data (JSON-LD) in Vanilla JS

> How to fix missing structured data (json-ld) in Vanilla JS — with the exact fix and copy-paste code.

_Category: AI readiness · Detector `aeo` · Check `structured-data-missing` · Severity: warning_

Answer engines and rich-result crawlers pull entities, facts, and answers out of `schema.org` `JSON-LD` — an author, a price, a rating, a FAQ. Without it they fall back to guessing from your prose, which is lossy and easy to get wrong. As AI assistants become how people find things, a page with no machine-readable summary is one they’re more likely to skip or misquote.

## The fix for Vanilla JS

Emit the script directly in server-rendered HTML (or static HTML). Keep it in the markup so non-JS crawlers read it.

```html
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Organization", "name": "Acme", "url": "https://acme.com" }
</script>
```

### Steps

1. Pick the `schema.org` type that matches the page (`Article`, `Product`, `FAQPage`, …)
2. Emit a `JSON-LD` script with `@context` `"https://schema.org"` and the key fields
3. Validate with Google’s Rich Results Test and `schema.org` validator

## How VibeCheck detects it

The `aeo` detector flags this live in the browser and reports it to the widget's Problems list — and to your coding agent over MCP.

- **Issue string:** `No structured data (JSON-LD)`
- **Threshold:** No <script type="application/ld+json"> present on the page

## FAQ

### Which `schema.org` type should I use?

Match the page: `Article`/`TechArticle`/`BlogPosting` for content, `Product` for a product, `FAQPage` for Q&A, `Organization`/`WebSite` for the site itself. You can include several types on one page.

### Does `JSON-LD` help with AI answer engines specifically?

Yes. Assistants like ChatGPT, Perplexity, and Google’s AI Overviews extract structured facts far more reliably than prose. Clean `JSON-LD` makes your page easier to cite accurately.

### `JSON-LD`, Microdata, or RDFa?

Google recommends `JSON-LD` — it’s a single script block separate from your markup, so it’s the easiest to add and maintain, and it’s what VibeCheck checks for.

See the general, framework-agnostic fix: https://vibecheck.wcgw.fun/fix/missing-structured-data.md

---

Fix guide from VibeCheck — https://vibecheck.wcgw.fun/fix/missing-structured-data. Full site index for LLMs: https://vibecheck.wcgw.fun/llms.txt
