Skip to main content

Guides

JSON-LD Schema Markup: A Practical Guide for Developers

Vibeus Moonscript

Vibeus Moonscript

August 12, 2025

JSON-LD Schema Markup: A Practical Guide for Developers

Schema markup is a vocabulary (schema.org) combined with a format (JSON-LD, usually) that tells search engines what your content represents. Not just “this is text” — but “this is a recipe for banana bread” or “this is an FAQ about API testing” or “this is an organization called DevBottle.”

Getting it right makes your pages eligible for enhanced search results: FAQ dropdowns directly in the results, breadcrumb navigation showing under your URL, product ratings, event dates, recipe cards. None of these are guaranteed even with correct markup, but you can’t get any of them without it.

Generate correct JSON-LD for common schema types.

Why JSON-LD over other formats

There are three ways to add schema markup to HTML: Microdata (inline attributes on existing HTML elements), RDFa (similar), and JSON-LD (a separate <script> block in the <head>).

Google recommends JSON-LD. The reason is practical: the markup doesn’t touch your HTML structure. It lives in a script tag that can be generated, updated, and validated independently of the page template. No risk of breaking your layout when updating schema, and no coupling between your semantic HTML and your schema definitions.

The basic structure

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "DevBottle",
  "url": "https://devbottle.com"
}
</script>

Every schema block needs @context (always https://schema.org) and @type (the schema type you’re using). Everything else depends on the type.

Schema types worth implementing

WebSite. Goes on your homepage. Identifies your site as an entity. The main value is that it can include a SearchAction for the sitelinks searchbox if your site has URL-based search. Even without that, it helps Google understand what your site is.

Organization. Your company or brand entity. Include name, url, logo, and sameAs (an array of links to your social profiles and other authoritative sources). The sameAs field is how Google connects your schema entity to its knowledge graph — important for brand recognition.

Article. For blog posts and editorial content. Important fields: headline, author, datePublished, dateModified, image. The dateModified field matters for freshness ranking signals — update it when you meaningfully revise the content, not on every build.

BreadcrumbList. Makes breadcrumb trails appear under your URL in search results. A Home > Blog > Post Title breadcrumb takes up more SERP real estate and signals site structure.

FAQPage. The most visually impactful schema type for most sites. When Google shows FAQ rich results, they appear as expandable Q&A pairs directly in the search listing — sometimes taking up the equivalent of three or four standard results.

FAQ schema in practice

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is a JSON formatter?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A JSON formatter adds indentation and line breaks to minified JSON to make it human-readable. It doesn't change the data -- only the whitespace."
      }
    },
    {
      "@type": "Question",
      "name": "Is the JSON formatter free to use?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. DevBottle's JSON Formatter is free, requires no account, and runs entirely in your browser."
      }
    }
  ]
}

A few things to get right: the name field is the question text (this is what appears in search results), and the text in acceptedAnswer should be a plain text answer without HTML. Keep answers concise — the expandable accordion in search results shows a preview before the user clicks through.

The questions should match what users actually search for. Generic placeholder questions won’t get picked up as rich results — real questions that match search queries will.

Validating before deploying

Two tools are essential for this:

Google’s Rich Results Test lets you paste a URL or code snippet and see which schema types were detected and whether any required fields are missing. Use this before deploying any new schema implementation.

Google Search Console shows the Enhancements tab after your pages are indexed. It reports rich result errors and warnings across your whole site, and shows which pages are eligible for which features.

Common validation issues: missing required fields (each type has its own requirements), incorrect date formats (use ISO 8601: 2026-06-06, not “June 6, 2026”), and inconsistent URLs between the schema and the actual canonical URL.

Keeping it accurate

Schema markup that misrepresents the page is worse than no schema markup. An Article schema with a dateModified that’s months out of date misleads Google about content freshness. A FAQPage with questions that don’t match what’s actually on the page creates a trust signal going the wrong direction.

The markup should describe the page as it currently is. Update dateModified when you revise content, keep FAQ answers synchronized with the page text, and don’t add schema types for content types your page doesn’t actually contain.

Generate JSON-LD schema markup for Organization, Article, FAQPage, BreadcrumbList, and more. Includes sample data for each type.