A Practical Guide to Structured Data for Developers
What is structured data?
Structured data is a standardised format for describing the content of a web page to search engines. The most common format is JSON-LD (JavaScript Object Notation for Linked Data), embedded in a <script> tag in your HTML.
When Google encounters structured data, it can use it to generate rich results — enhanced search listings with star ratings, FAQ accordions, breadcrumbs, and more.
Common schema types you should know
Schema.org defines hundreds of types, but a handful cover most use cases. Article and BlogPosting for content sites, Product and Offer for ecommerce, FAQPage for support content, and Organization for company info.
BlogPosting— for blog posts with author, date, and imageFAQPage— renders an expandable FAQ in search resultsBreadcrumbList— shows a breadcrumb trail below the page titleOrganization— provides company details in the knowledge panel
Implementing JSON-LD in Next.js
The cleanest approach is to create a helper function that builds the JSON-LD object, then render it in a <script type="application/ld+json"> tag. Keep the schema construction separate from the rendering so you can test it independently.
In a Next.js App Router project, you can include the script tag directly in your page or layout component. Since it is a server component, the JSON-LD is embedded in the initial HTML — no client-side JavaScript required.
Testing and validating your markup
Google provides a Rich Results Test that checks whether your structured data is eligible for enhanced search features. Schema.org also maintains a validator for checking syntax.
Always test after deploying. The most common issues are missing required fields, incorrect data types, and mismatched URLs between your canonical tag and the structured data.
Key takeaways
- JSON-LD is the recommended format for structured data.
- Focus on BlogPosting, FAQPage, and BreadcrumbList for content sites.
- Build schema objects in helper functions for testability.
- Validate with Google's Rich Results Test before deploying.