Vocabulary, format and search requirements
Schema.org defines types, properties and their meaning; JSON-LD 1.1 is a W3C Recommendation for representing linked data in JSON. The same model can also be expressed with Microdata or RDFa. JSON Schema, by contrast, describes and validates JSON structures, not an entity vocabulary. Syntactically valid JSON may contain unknown Schema.org properties, and valid Schema.org data may fail a particular consumer's requirements. [1][2][3]
JSON-LD, Microdata or RDFa?
| Format | Strengths | Limitations |
|---|---|---|
| JSON-LD | Separate from HTML; easy CMS generation | Must stay aligned with visible content |
| Microdata | Properties directly in HTML | Tightly coupled to templates |
| RDFa | Flexible vocabularies and relationships | More complex markup |
JSON-LD separates the data model from HTML structure, making generation from a CMS or backend straightforward. Microdata binds properties to HTML elements via itemscope, itemtype and itemprop; RDFa uses attributes such as vocab, typeof and property. Both are useful when markup follows template content directly. Google supports all three and recommends JSON-LD when appropriate. Maintaining multiple copies of the same data in different formats is unnecessary. [3][4]
Entity modelling, @id and @graph
@context gives compact terms their meaning, @type specifies the entity type, @id identifies a node using an IRI, and @graph can represent multiple related nodes. A reference containing only @id points to an entity instead of making an independent copy. Use stable absolute identifiers, such as a page URL with a #article fragment. An identifier need not be a separate page and does not replace canonical. One organization may keep its identity across documents, but different articles must not accidentally share the same @id. [1][2]
A practical article graph
article.json
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Studio",
"url": "https://example.com/"
},
{
"@type": "Person",
"@id": "https://example.com/authors/alex#person",
"name": "Alex Morgan",
"url": "https://example.com/authors/alex"
},
{
"@type": "WebPage",
"@id": "https://example.com/en/learning/data#webpage",
"url": "https://example.com/en/learning/data",
"inLanguage": "en",
"breadcrumb": {
"@id": "https://example.com/en/learning/data#breadcrumb"
},
"mainEntity": {
"@id": "https://example.com/en/learning/data#article"
}
},
{
"@type": "BlogPosting",
"@id": "https://example.com/en/learning/data#article",
"mainEntityOfPage": {
"@id": "https://example.com/en/learning/data#webpage"
},
"headline": "Understanding structured data",
"inLanguage": "en",
"datePublished": "2026-11-20T10:00:00+01:00",
"dateModified": "2026-11-30T09:00:00+01:00",
"image": ["https://example.com/images/data.webp"],
"author": {
"@id": "https://example.com/authors/alex#person"
},
"publisher": {
"@id": "https://example.com/#organization"
}
},
{
"@type": "BreadcrumbList",
"@id": "https://example.com/en/learning/data#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Learning",
"item": "https://example.com/en/learning"
},
{
"@type": "ListItem",
"position": 2,
"name": "Understanding structured data"
}
]
}
]
}
The example describes a fictional English article, its author, publisher, web page and breadcrumb hierarchy. Replace example.com and sample data with real values. WebPage and BlogPosting have distinct identities; mainEntity and mainEntityOfPage relate the document to its main content. Author and publisher are linked by references rather than duplicate names. ISO 8601 timestamps include time zone offsets. Use genuine publication and modification dates and accessible images. Google's Article guide lists recommended properties rather than a universal required set; BreadcrumbList has separate requirements. [5][6]
Selecting types and current Google support
| Type | Purpose | Conditions and limitations |
|---|---|---|
| Article / BlogPosting | Publication | Real author, dates and images |
| Organization / Person | Publisher or author identity | No knowledge panel guarantee |
| LocalBusiness | Local establishment | Real address and opening hours |
| BreadcrumbList | Navigation hierarchy | Correct order and URLs |
| Product / Offer | Product and sale terms | Separate product snippet and merchant listing requirements |
| SoftwareApplication | Application | Name, offer and a rating or review for Google feature |
| FAQPage | Questions and answers page | No Google FAQ enhancements since May 2026 |
Choose a type based on the primary page content, not the desired search appearance. Organization describes an organization, LocalBusiness an actual local establishment, and Person can describe an author. Product represents a product, SoftwareApplication software, and BreadcrumbList a navigation hierarchy. Not every type has its own rich result. Google stopped displaying FAQ rich results on May 7, 2026 and subsequently removed the feature documentation. FAQPage remains a Schema.org type, but should not be used solely to promise FAQ enhancements. [7][8][9][10][11][12][23][24][26]
In practice start with the page template, not every available type. For a knowledge base use Article or BlogPosting, WebPage and BreadcrumbList, and model the publisher as a stable Organization. For a genuine author profile consider ProfilePage with mainEntity referencing Person. sameAs identifies another source representing the same entity, not arbitrary related pages. Google recommends Organization data on the home page or a page describing the organization. [2][5][23][26]
Products, offers and commerce data consistency
product.json
{
"@context": "https://schema.org",
"@type": "Product",
"@id": "https://example.com/products/desk-lamp#product",
"name": "Desk lamp",
"image": "https://example.com/images/desk-lamp.webp",
"sku": "LAMP-01",
"offers": {
"@type": "Offer",
"url": "https://example.com/products/desk-lamp",
"price": 49.9,
"priceCurrency": "EUR",
"availability": "https://schema.org/InStock",
"itemCondition": "https://schema.org/NewCondition"
}
}
Product describes an item; Offer describes its commercial terms. The example models one fictional offer, not every merchant listing requirement. Price, currency, availability and URL must reflect the current offer available to users. For product snippets Google requires a name and at least one of offers, review or aggregateRating; merchant listings have distinct requirements including image and offer data. Never invent ratings. For variants, evaluate ProductGroup and variant relationships against current documentation; keep Merchant Center data aligned with the page. [9][13][14][25]
Google excludes self-serving reviews of LocalBusiness or Organization from their own review stars, including embedded third-party review widgets controlled by the reviewed entity. This concerns review snippet eligibility, not a prohibition on publishing genuine reviews. On product pages do not copy ratings from an unrelated variant. [13][25]
SSR, CSR, SSG and ISR: one source of truth
Related resources: SSR vs CSR vs SSG vs ISR.
Generate markup from the same model as the visible headline, price or description. With SSR include JSON-LD in the HTML response; with SSG regenerate it at build time; with ISR invalidate cached markup alongside content. Google can process JavaScript-generated markup and does not require SSR, but inspect the rendered document. Dynamic product markup may make Shopping crawls less frequent or reliable, especially for changing prices. In an SPA, remove or update previous-page markup when navigating. [4][15][16]
Multilingual sites and entity identity
Use the appropriate URL, headline, description and inLanguage, such as pl, en or uk, for translations. A publisher can retain one stable identity while distinct pages and article versions have distinct identifiers in this model. Do not point every translation's mainEntityOfPage to the English URL. Canonical and hreflang remain separate HTML mechanisms; inLanguage does not replace hreflang. Local offers must use the correct currency and terms. [1][2][17]
Safe JSON-LD serialization
serialize-json-ld.ts
export type JsonValue =
| null
| boolean
| number
| string
| readonly JsonValue[]
| { readonly [key: string]: JsonValue };
export function serializeJsonLd(value: JsonValue): string {
const json = JSON.stringify(value);
if (json === undefined) {
throw new TypeError("Expected JSON-serializable data");
}
return json.replace(/</g, "\\u003c");
}
export function renderJsonLdScript(value: JsonValue): string {
const content = serializeJsonLd(value);
return `<script type="application/ld+json">${content}</script>`;
}
A script element with application/ld+json contains data, but the HTML parser still recognizes its closing tag. JSON.stringify alone does not protect against injected closing script tag text. The TypeScript example serializes validated data and replaces less-than characters with a Unicode escape, preserving values after JSON.parse. This is encoding for the script text context, not a general HTML sanitizer. JsonValue is not runtime validation; validate the domain contract, URLs and finite numbers before calling it. Do not fetch arbitrary remote JSON-LD contexts in an untrusted process. [1][18]
Both JSON examples contain data only: embed them in a script element with type application/ld+json in the described page's HTML. For dynamic rendering use the function below after validating domain data. A CMS with multiple content types benefits from separate article and product mappings, shared serialization and contract tests for those mappings. Do not turn the serializer into a mechanism that guesses entity types. [15][18]
Validation, deployment and monitoring
| Tool | Checks | Does not confirm |
|---|---|---|
| JSON parser | JSON syntax | Entity meaning |
| Schema Markup Validator | Schema.org vocabulary | Google feature eligibility |
| Rich Results Test | Supported types and some Google requirements | Display in search |
| Search Console | State observed by Google | Real-time state of entire site |
Related resources: robots.txt / sitemap.xml.
Separate JSON syntax checks, Schema.org vocabulary checks, eligibility for Google features and actual display. Schema Markup Validator inspects vocabulary; Rich Results Test checks supported features; Search Console reports Google's observed state for available reports. Test representative URLs after deployment and inspect rendered HTML. In CI check parsing, identifier consistency and alignment with domain data. Absence of a report or errors does not prove overall correctness. Compare impressions and clicks by page type and period, accounting for seasonality, ranking and content changes. [4][19][20]
SEO, GEO and common anti-patterns
Related resources: POLPROG structured data generator.
Structured data helps interpret content and can enable eligibility for specific features, but guarantees neither indexing, better rankings nor higher CTR. Google requires no special schema for generative search features. Do not mark up invisible content, fabricate ratings or add unrelated types. Policy violations can lead to manual actions affecting rich results without necessarily removing the page from the index. The POLPROG generator helps build graphs and catch some issues, but does not replace current documentation or testing the actual page. [4][7][21][22]
