Skip to content
Auto Genius Help Center home
InboxAsk a human

How to add a JSON-LD override

Updated by Kyle

Use a JSON-LD override when a content page needs custom structured data. This feature applies to pages served through a route using the Default layout.

The override replaces the entire generated graph. Include every entity you want the page to retain.

1. Open the page's SEO settings

Open the page in Sanity and select SEO. Use the page's override for structured data about that page.

Check the connected route before editing. An enabled route override takes priority over the page override. Route overrides are available for the Default layout.

2. Enable the override

Turn on Override JSON-LD?. The JSON-LD Override code field appears.

Paste the complete JSON into that field. Do not include HTML <script> tags.

The JSON must:

  • Be a nonempty JSON object.

  • Include an @context referencing schema.org.

  • Include @type or @graph at the root.

  • Contain no more than 5,000 characters.

Resolve any validation errors before publishing.

3. Adapt a complete example

This example describes a website and an About page. Replace every example URL and name with your own values. Use the page's public URL.

{ "@context": "https://schema.org", "@graph": [ { "@type": "WebSite", "@id": "https://example.com/#website", "url": "https://example.com/", "name": "Example Motors" }, { "@type": "WebPage", "@id": "https://example.com/about#webpage", "url": "https://example.com/about", "name": "About Example Motors", "description": "Learn about Example Motors.", "isPartOf": { "@id": "https://example.com/#website" }, "inLanguage": "en-US" } ] }

Update the description and language to match the page. Keep the website's @id consistent with the isPartOf reference.

For multilingual sites, review the override on each language version. Custom JSON-LD is not automatically translated.

Add Article or FAQPage nodes only when their details match content visitors can read. Those types are not automatically added to ordinary content pages.

4. Review the draft

Keep the change as a draft while reviewing. Use your site's approved preview to confirm the correct page loads.

Check that the JSON-LD describes the visible content. Verify URLs, names, language, and references between entities. Use public page URLs in the graph, even while reviewing a preview.

Validate the JSON-LD with the Schema Markup Validator. Use the Google Rich Results Test to check supported search features. A valid graph does not guarantee a rich result in search.

5. Publish and verify

Publish the page after review. Publish the route too if you changed its override.

Check the live page's structured data after the update appears. Confirm that the replacement graph is present and that it contains the intended entities.

Return to generated structured data

Turn off Override JSON-LD? on the page and route wherever it is enabled. Publish each changed document.

Generated structured data returns when neither override is active. You can leave the saved JSON in the code field for later use.