Skip to main content

Structured data & schema markup

What is structured data?

Structured data helps search engines understand the content of your pages better. You can add schema markup using JSON-LD by inserting it directly into the page. This lets the markup exist in the HTML sent from the server, which is important for SEO. Schema markup is a structured data format that helps search engines better understand your website’s content. If you are a cooking website, recipe schema can provide additional context to search engines about your recipes.

Why use structured data?

Common schema types

Best for blog posts, news articles, and editorial content.
For company or brand pages.
For e-commerce and product pages.
For frequently asked questions pages.

Implementing schema in Angular

In Angular, you can add schema markup using JSON-LD by inserting it directly into the page with Renderer2:
This code adds schema.org structured data using JSON-LD inside a <script> tag. Search engines read this to understand the page content better.

Implementing schema in React/Next.js

For React and Next.js applications, you can create a reusable component for structured data:

Using ButterCMS data for schema

When fetching content from ButterCMS, map your content fields to schema properties:

Blog Post article schema

Page schema with SEO Component

Collection items (e.g., FAQ schema)

Creating a schema Component in ButterCMS

You can create a dedicated Structured Data component in ButterCMS to give content editors control over schema markup:
Then in your frontend:

Testing your structured data

Always validate your structured data before deploying to production.

Common validation errors

Watch out for these common structured data errors:
  • Missing required properties (e.g., image for Article)
  • Invalid date formats (use ISO 8601: YYYY-MM-DD)
  • URLs without proper protocol (https://)
  • Invalid JSON syntax