Structured Data with JSON-LD
Adds structured data using JSON-LD format for Schema.org markup to help search engines understand page content and enable rich results.
Code
<!DOCTYPE html>
<html lang="en">
<head>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Use Structured Data",
"author": {
"@type": "Person",
"name": "Jane Doe",
"url": "https://example.com/authors/jane"
},
"datePublished": "2025-01-15",
"dateModified": "2025-01-16",
"image": "https://example.com/images/article.jpg",
"publisher": {
"@type": "Organization",
"name": "Example Site",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},
{
"@type": "ListItem",
"position": 2,
"name": "Articles",
"item": "https://example.com/articles"
}
]
}
</script>
</head>
<body>
<article>
<h1>How to Use Structured Data</h1>
<p>Article content...</p>
</article>
</body>
</html>What the code does
The markup uses the semantic elements article instead of generic containers, giving assistive technology and search engines real structure without extra wiring.
Statements that matter
<html lang="en">
<script type="application/ld+json">
<h1>How to Use Structured Data</h1>
Interactive Tools for This Topic
JSON to Zod Schema ConverterInfer typed Zod z.object schemas from JSON payloads locally, supporting nested objects, merged array shapes, enums, nullable fields, and JSDoc comments.INI File ParserParse INI configuration files into nested JSON with section objects, global keys, and both semicolon and hash comment support.JSON Schema ValidatorValidate JSON data against a JSON Schema definition and get detailed error reports. Supports type checking, required fields, and common constraint validation.JSON to TOML ConverterTurn a JSON object into TOML, emitting nested objects as tables and arrays of objects as array-of-tables blocks.
FAQ
- Why semantic elements instead of divs?
- `<article>` expose document structure to assistive technology and search engines without ARIA or class-name conventions.
Report a problem with this exampleOpens a pre-filled issue on GitHub.