Technical
Structured Data and JSON-LD: Making Your Content Machine-Readable
Search engines read your HTML but they do not understand it. They see text and links. JSON-LD structured data tells them what the text means: this is an article, written by this person, published on this date, about this topic. Here is how to implement it.
What JSON-LD Is
JSON-LD (JavaScript Object Notation for Linked Data) is a way to embed structured metadata in your HTML pages. It uses the Schema.org vocabulary to describe content in a way that search engines, AI engines, and other machines can parse.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Build a Blog API with FastAPI",
"datePublished": "2025-04-06T10:00:00Z",
"author": {
"@type": "Person",
"name": "Chadi Abi Fadel"
}
}
</script>Why It Matters
JSON-LD enables:
- Rich search results: Google shows enhanced listings with author, date, and ratings
- Knowledge panels: Your content can appear in Google's Knowledge Graph
- AI engine citations: ChatGPT, Perplexity, and Google AI cite structured content
- Social sharing: Platforms parse structured data for preview cards
Without structured data, search engines guess what your content is about based on text analysis. With it, they know exactly what it is.
Common Schema Types
| Type | Use Case | |------|----------| | Article | Blog posts, news articles, tutorials | | FAQPage | Frequently asked questions pages | | Organization | Company information, logo, contact | | Person | Author profiles, team pages | | WebSite | Site-level search configuration | | BreadcrumbList | Navigation breadcrumbs |
Implementing in Next.js
In a Next.js App Router project, add JSON-LD to your page component:
export default async function BlogPost({ params }) {
const post = await fetchPost(params.slug);
const jsonLd = {
"@context": "https://schema.org",
"@type": "Article",
"headline": post.title,
"datePublished": post.publishedAt,
"author": {
"@type": "Person",
"name": "Chadi Abi Fadel",
"url": "https://peaklight.ai"
}
};
return (
<>
<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<article>{/* post content */}</article>
</>
);
}Testing Your Structured Data
Google provides two free testing tools:
- Rich Results Test: Tests if your structured data qualifies for enhanced search results
- Schema Markup Validator: Validates JSON-LD syntax and schema compliance
Run every page through both tools before launch. Syntax errors in JSON-LD silently fail, meaning search engines ignore your structured data without telling you.
The AEO Angle
Answer Engine Optimization (AEO) is the practice of optimizing for AI-powered answer engines like ChatGPT and Perplexity. These engines prefer content with clear structured data because it makes citation and attribution easier. Adding JSON-LD today positions your content for both traditional search and the emerging AI-driven discovery landscape.
See Google's structured data documentation for the complete implementation guide.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read