Strapi is an open-source next-gen headless Content Management System used to develop websites, mobile applications, and APIs. As a headless CMS, Strapi is a back-end-only web content management system acting as a content repository. Content is accessible via an API and displayed on any device.

Strapi has been gaining popularity among developers and is the top solution for headless CMS worldwide.

strapi usage graph between 2019 and 2022
Source: https://trends.builtwith.com/cms/Strapi
Statistics for websites using Headless technologies
Source: https://trends.builtwith.com/cms/headless/traffic/Entire-Internet 

As the number of websites created with Strapi increases, it’s crucial for webmasters to ensure the sites are SEO-friendly.

Strapi and SEO

Strapi claims to be the best content management system for SEO. Let’s investigate that claim.

According to their website, these are the essential SEO components:

  • URL structure
  • Metadata and media
  • Structured data
  • Content clustering

URL structure 

A simple, logical, and user-friendly URL will be easier for Google to crawl and understand, as well as being more enticing for users in SERP. Consider the following examples:

  • https://www.example.com/product/03423047
  • https://www.example.com/product/green-maxi-dress

Having a logical, easy-to-read URL path is a must. Strapi allows you to create a slug based on the name of your content by assigning a specified name value to the slug (UID). 

slug field preview in strapi

The setup can be specified using the Content-type Builder functionality in the Strapi dashboard.

Metadata 

Your metadata gives you some influence on your page appearance in SERP. Strapi advise populating:

  • title
  • description
  • keywords
  • robots.

A title may be used to influence the title link in search results, as shown below.

title link preview in SERP

A description may also be used to create a clear description of the page’s content in search results, as shown here.

description preview in SERP

Google uses many different sources to automatically determine the title link and meta description, and it may use anchor text, on-page text or other sources to create an improved title link.

The title can either be populated with the Strapi SEO Plugin or by creating a text field where the title tag will be stored. Conditions can be added, such as not being shorter than or not exceeding a set amount of characters.

meta title in strapiKeywords

Strapi advises populating keywords to ensure your content is SEO-friendly. Google stopped supporting meta keywords in 2009, making them redundant regarding SEO value. Meta keywords can be used to tag or categorise content internally, but are not a crucial part of SEO optimisation. 

Populating keywords data may be useful to cross-reference requirements (if specified) in title tags and meta descriptions to ensure target keywords are included in relevant fields. 

Meta robots

Meta robots give you control over content indexability. To prevent pages from appearing in Google indexing should not be allowed. A ‘prevent indexing’ field needs to be created with the default Boolean value set to false to ensure pages are indexable and can appear in SERP. 

Media 

An alt attribute text field needs to be populated for the media files site-wide to make sure alt text can be added to images to ensure the website follows SEO and accessibility guidelines. 

Structured data

Utilising structured data to markup content can help Google understand the content of your website. Structured data is a standardised format for providing information about a page and accurately classifying the page’s content. A structured data field needs to be created for each individual schema.org type, such as one of the following:.

  • Organisation
  • LocalBusiness
  • Website
  • FAQs
  • Event
  • Product
  • AggregateRating
  • Reviews

An SEO may need to provide detailed information about required schema types for individual websites and pages based on their offering. 

Content clustering

Content clustering within Strapi is being used to improve user experience and search performance by utilising the ‘Related Products’ and ’You May Also Like’ components. To take advantage of content clustering, the RelatedProducts component and Products category needs to be created, and required fields need to be populated. Ensure the RelatedProducts component has an Intro and a Relation field to populate the frontend text a user sees. 

Strapi SEO plugin

You can use Strapi’s official SEO plugin that provides top-level information about SEO elements. According to the official documentation, the main features of the plugin are:

  • An overview of SEO components for content types
  • meta tags (title, description) management and SERP preview
  • social meta tags (Facebook and Twitter) management and post preview
  • strong SEO content analysis.

It does not appear that the plugin provides as many options as Yoast or RankMath, such as:

  • canonical URL
  • structured data
  • 301 redirects
  • internal and External Links
  • breadcrumbs

Strapi and SEO-related issues

The following pages built with Strapi were checked with a crawler against the most common issues that may affect organic performance:

Let’s take a look at some issues experienced by audited Strapi sites.

Payloads/DOM size

An excessive DOM size increases the number of bytes transferred, resulting in increased data costs and slower page load speed. It will also slow down the rendering of your page, and overwhelm the memory capabilities of your user’s devices. Redundant code should be removed from affected page templates to reduce DOM size, improve page load, and minimise data usage.

Unused JavaScript being loaded

This involves JavaScript code that is not necessary for rendering a page but may have a negative impact on the Core Web Vitals metrics. 

coverage report with unused JavaScripts
Source: https://www.phoenix.edu/

A correlation between unoptimised JS files and Core Web Vitals.

Core Web Vitals result for Univercity of Pheonix
Source: https://www.phoenix.edu/

Removing unused JavaScript files offers a potential saving of 2s, which would bring down the LCP value to 3.2s, moving the metric from ‘Poor’ to ‘Needs Improvement’.

Canonical issues

The canonical link was either changed to a different URL or inserted by JavaScript for a number of tested Strapi sites. Google does not recommend using JavaScript for canonical link implementation since the incorrect use of JavaScript may lead to unexpected results.

Final thoughts

Whether a headless or a traditional CMS, SEO should be implemented as soon as possible to ensure websites follow best practices. Any SEO working with Strapi should provide an extensive and in-depth list of SEO elements for each page template, which could include:

  • Meta title
  • Meta description
  • Canonical list
  • H1
  • Hreflang
  • Meta robots
  • Structured data (in JSON LD)
  • Open graph
  • Relation (content clustering)