Skip to main content

SEO & Social Components

SEO is must-have for any content, so creating a reusable SEO component is one of the first things you should do when setting up your ButterCMS project. This component can be reused across all your Page Types for consistent search optimization.

Why create SEO Components?

Consistency

Same SEO fields across all Page Types

Completeness

Ensure no SEO field is forgotten

Efficiency

Update SEO schema once, apply everywhere

Best Practices

Built-in validation for SEO guidelines

Building an SEO Component

An SEO component can be quite simple: SEO component schema Our fields will be:
  • A Short Text field for our meta title
  • A Short Text field for our meta description
    • You can set a max of 150-160 characters for SEO best practices by clicking on the Gear (⚙️) icon
  • A Media field for our open graph image when sharing the blog post via social media and messaging platforms
  • A Date field to set our original published date for SEO and JSON-LD

Essential SEO fields

Core meta tags

Open Graph tags (social sharing)

Twitter card tags

Complete SEO Component schema

Here’s a comprehensive SEO component that covers all essential metadata:

Rendering SEO tags

Using React Helmet to generate the head HTML tags:

Next.js example

Social sharing preview Component

For pages where social sharing is critical, create a dedicated social preview Component:
This allows content editors to customize messaging per platform while maintaining SEO as a separate concern.

Image requirements

Open Graph (Facebook, LinkedIn)

Twitter cards

Pinterest

Structured data Component

For enhanced search results, create a structured data Component:

Rendering JSON-LD

Best practices

Set meta title, meta description, and OG image as required fields to ensure content is never published without essential SEO metadata.
Configure max character limits based on platform guidelines: 60 for titles, 160 for descriptions.
Set default robots to “index, follow” and default OG type to “website” so editors don’t need to set them for standard pages.
Include guidance in field help text, like “Keep under 60 characters for best display in search results.”
In your frontend, let Twitter fields fall back to OG fields, and OG fields fall back to meta fields when empty.
Use help text to remind editors of recommended image dimensions for each platform.

SEO Component variations

Consider creating specialized SEO Components for different content types:

Article SEO Component

Enhanced for blog posts and articles:
  • Article-specific schema type
  • Author reference
  • Reading time
  • Article section/category
  • Publication and modification dates

Product SEO Component

Enhanced for e-commerce:
  • Product schema type
  • Price
  • Availability
  • Brand
  • SKU
  • Reviews/ratings

Event SEO Component

Enhanced for events:
  • Event schema type
  • Start/end dates
  • Location
  • Performer/organizer
  • Ticket availability

Testing your SEO setup

After implementing your SEO Components, validate them with these tools: