Skip to main content

Rendering SEO data

This guide covers how to render SEO data from the ButterCMS API in your frontend framework, including meta tags, Open Graph tags, and Twitter Cards.

Framework implementations

React / Next.js

Reusable SEO Component

You can use the next/head submodule to encapsulate modifications to the head element. Normally, you would have an SEO React component that would do this for you:
Then use this component in each of your pages:

Per-Page implementation with Open Graph

Angular

Meta tags like the page title and Open Graph tags play a big role in SEO. In Angular SPAs, you must update these tags dynamically as users navigate across different routes and make sure they’re ready when crawlers arrive. Angular provides the Title and Meta services to handle this:

Jekyll

In Jekyll, each page is compiled from a markdown file. The header of the markdown file will contain the title and description variables that will be used in the template:
The default layout template uses these variables:

Vue / Nuxt.js

Using ButterCMS API data for meta tags

When fetching content from ButterCMS, you’ll have access to SEO fields that you can use to populate your meta tags:
For Pages with an SEO component:

Creating an SEO Component in ButterCMS

Create a reusable SEO & Social component to give editors control over social sharing:
Then in your template:
Ready to add social sharing buttons to your site? See Add Social Sharing Buttons for a step-by-step guide.