Schema guides Platform
How to add schema to Gatsby
Category: framework
Plugins and apps
- gatsby-plugin-react-helmet
- onRenderBody in gatsby-ssr
Manual implementation
Inject `<script type="application/ld+json">` via Helmet in layouts or `onRenderBody`; source fields from GraphQL queries.
Troubleshooting
- Duplicate plugins outputting schema
Audit `gatsby-config` plugin order; disable redundant SEO plugins. - Stale head after content change
Clear `.cache` and rebuild; confirm GraphQL query pulls fresh fields.
Overview
Gatsby's build-time GraphQL is ideal for JSON-LD: each template query can assemble Article, Product, or LocalBusiness nodes from CMS data.
Keep JSON-LD generation in SSR/build paths, not browser-only effects, so crawlers see complete graphs.