Headless CMS SEO: Rendering, Metadata, Sitemaps and Previews

A headless CMS has no SEO plugin, so the content model and the front end have to do that job. Here's the contract that keeps rendering, metadata, sitemaps and previews from breaking.

Pixel-art server beside a browser window, showing content stored in one system and rendered as a page in another.

Headless CMS SEO is making sure a site that stores content in one system and renders it in another still gives search engines clean HTML. The CMS has no SEO plugin, so you build the job yourself. Put SEO fields in the content model. Render them on the server. Sync sitemaps on publish. Keep previews private.

A headless CMS splits a website in two. The CMS holds the content. A separate front end, often a Next.js app, turns that content into pages. That split is great for speed and design freedom. It also removes everything a classic CMS did for SEO without being asked.

In my experience, it goes wrong in the same four places. Think of them as the four seams: rendering, metadata, sitemaps and previews. This guide covers each one, the fields your content model needs, the money math and a checklist.

Key takeaways

  • The content model is your SEO plugin. If a field isn't in the schema, editors can't set it without a developer.
  • Render SEO tags on the server. Titles, canonicals and robots tags belong in the first HTML response.
  • Build the sitemap from the CMS. Publish webhooks should update it within minutes.
  • Lock down previews. Draft pages need a secret and a noindex header on every host.
  • Write the contract down. One page that says which system owns each SEO job saves months of tickets.

What is headless CMS SEO?

A traditional CMS owns the whole page. It stores the post, picks the template and writes the HTML. An SEO plugin sits inside it and adds title tags, sitemaps and redirects.

A headless CMS only stores content and serves it through an API. The front end asks for that content and builds the page. Nothing in the middle adds SEO by default.

So headless CMS SEO is a split job. The CMS has to hold the data. The front end has to turn it into tags. I call the written agreement between the two the SEO contract. It's a short doc that says who owns what. Most of the technical SEO failures I see on headless sites trace back to a missing line in that doc.

How does a headless CMS change what Google sees?

Google handles script-heavy sites in three phases: crawl, render and index. Its JavaScript SEO basics guide says a page can sit in the render queue "for a few seconds, but it can take longer than that." Until rendering runs, Google only has the raw HTML.

That's the first seam. If your front end fetches content in the browser, the first HTML is an empty shell. Google may render it later. Many other crawlers never will. The same guide still calls server-side or pre-rendering "a great idea," partly because not every bot can run scripts.

The fix is simple to state. Every indexable page should arrive with its content and SEO tags already in the HTML. Static pages built ahead of time do this. So does server rendering. Pages built only in the browser don't. The JavaScript SEO guide covers how to test what crawlers actually see.

Which SEO fields belong in the content model?

This is the part most teams skip. A developer builds the "Blog post" type with a title, a body and an author. Six months later, marketing wants a different title tag. Now it's a ticket.

Put these fields in every page type that can be indexed.

Field Type Why it matters
SEO title Text, required, length limit Lets the title tag differ from the on-page headline
Meta description Text, required, length limit Feeds the meta description tag
Slug Text, unique, validated Controls the URL
Canonical override URL, optional For syndicated or near-duplicate pages
Noindex Toggle, default off Lets editors hide thin or private pages
Social image Image Open Graph and link previews
Alt text Required on every image asset Accessibility and image search
Last significant update Date, set by hand Drives sitemap lastmod and the visible date
Old slugs List of text Builds redirects when a URL changes
Schema type Choice list Picks the structured data the front end writes

Two of these deserve a note. The "last significant update" date should be set by a person, not by the system. Most CMSs bump their own updated date on any save, even a typo fix. The old slugs field matters because URLs change. Without it, every slug edit makes a broken link.

How should metadata and canonicals render?

Write every SEO tag into the HTML on the server. Don't inject it later with a script.

Google's guide is blunt on canonicals: "The best way to set the canonical URL is to use HTML." If you must set one with a script, it should match the one in the HTML, and there should only be one. Noindex is riskier still. Per the same guide, when Google sees a noindex tag, "it may skip rendering and JavaScript execution." So a script can't reliably remove a noindex that the first HTML carried.

Links follow the same rule. Google says it "can only discover your links if they are <a> HTML elements with an href attribute." Buttons that route on click don't count as links.

In practice, your page template should read the CMS fields and write the title, description, canonical tag and robots tag in the server response. In Next.js, that's the metadata API. The Next.js SEO on Vercel guide has the code. For when to use a canonical at all, see the canonical tags guide.

How do you keep sitemaps in sync with the CMS?

A plugin used to rebuild the sitemap on every publish. Now that's your job.

Build the XML sitemap in the front end, from the CMS API. Include only published pages with noindex off. Use full URLs. Google's guide to building a sitemap caps each file at 50,000 URLs or 50MB uncompressed. Bigger sites split into several files under a sitemap index.

Lastmod is where headless sites lose trust. Google says it uses lastmod only when it's accurate, and checks it against the page. It also says it ignores priority and changefreq. If your sitemap stamps every URL with the last deploy time, the date means nothing. Pull lastmod from the "last significant update" field instead.

Then close the loop with a webhook. When an editor publishes, the CMS calls your front end. The front end rebuilds that one page and the sitemap. New pages appear in minutes, not at the next full build. The XML sitemap guide covers splitting and submitting, and the free XML sitemap validator checks the file.

How do you set up previews without leaking drafts?

Editors need to see a draft before it goes live. Headless sites do this with a preview link. Done badly, that link puts drafts in Google.

Next.js has a built-in pattern for this. Its draft mode guide has the CMS open a route with a shared secret. The route checks the secret, then sets a cookie named __prerender_bypass. Requests with that cookie skip the cache and fetch the draft. Everyone else still sees the published page.

The second guard is a noindex header on every preview host. Vercel adds X-Robots-Tag: noindex to preview deployments by default, per its guide on preview indexing. But it does not add it when a branch is served from a custom domain like staging.example.com. That's the gap I see most. Treat every staging environment as public until a header check proves otherwise. If you host on Vercel, check each domain after any change.

One more trap: don't rely on robots.txt alone for staging. A blocked page can still be indexed from links, without its content. The noindex vs disallow guide explains why.

The headless SEO contract, step by step

Here's the order I'd build it in. Each step names an owner.

Stack of four layers: content model, front end, delivery and preview, with the front end in orange where SEO tags reach the HTML.Stack of four layers: content model, front end, delivery and preview, with the front end in orange where SEO tags reach the HTML.
Each layer owns part of the SEO job a plugin used to do. The front end is where the fields become tags in the first HTML response.
  1. Add the SEO fields to the content model. Owner: whoever owns the CMS schema. Make title and description required.
  2. Render tags on the server. Owner: front end. Title, description, canonical and robots tags in the first HTML.
  3. Pick a render mode per page type. Static for posts and landing pages. Server rendering only where data changes on each visit.
  4. Generate the sitemap from the CMS. Lastmod from the hand-set date. Noindex pages left out.
  5. Wire the publish webhook. Rebuild the page and the sitemap on publish, unpublish and slug change.
  6. Build redirects from old slugs. One hop to the new URL, every time.
  7. Lock previews. Secret token, cookie, and a noindex header on every preview host.
  8. Test before launch. Fetch raw HTML for each page type and read the tags.

If you're moving from a classic CMS, do all eight before the switch. The site migration SEO guide covers the redirect map and launch-day checks.

Worked example: what the SEO contract saves on a 400-page site

Here's the math with assumed numbers. Plug in yours.

Bar chart of monthly developer hours on SEO changes: no SEO fields 30, partial fields 12, full SEO contract 3.Bar chart of monthly developer hours on SEO changes: no SEO fields 30, partial fields 12, full SEO contract 3.
Worked example with assumed numbers: 20 SEO changes a month at 1.5 developer hours each. Worked example from this guide.

Say a startup moves a 400-page site to a headless CMS. Marketing makes 20 SEO changes a month: new titles, description rewrites, a canonical here, a noindex there. Assume each change takes a developer 1.5 hours once you count context switching and review.

No SEO fields. All 20 changes need a developer. That's 30 developer hours a month. Changes also wait in the queue, so a title test that should take a day takes a sprint.

Partial fields. Title and description are in the schema, but canonicals, noindex and redirects aren't. Say 8 changes still need a developer. That's 12 hours.

Full SEO contract. Editors handle almost everything. Say 2 changes a month still need code, for new schema types or odd edge cases. That's 3 hours.

Adding the fields is usually a few days of work up front. It pays back in the first month.

What are the common headless CMS SEO mistakes?

Rendering content in the browser. The first HTML is empty. Google may catch up. Other crawlers won't.

Using the system updated date as lastmod. Every save bumps it. Google learns to ignore your dates.

No noindex toggle. Thin tag pages and test pages go live, and nobody can hide them without a deploy.

Slug edits with no redirect. An editor fixes a typo in a URL. The old URL now returns a 404, along with its links.

Preview on a public custom domain. The branch domain has no noindex header. Drafts and test copy end up in search.

Two canonicals. One from the template, one from a script. Google has to guess, and it may guess wrong.

What should you do this week?

If you're planning a rebuild, the website relaunch use case shows how I scope the SEO side. My website service builds headless sites with the contract in place from day one.

My take: headless is an SEO choice, not just a tech choice

Headless isn't good or bad for SEO. It's honest. It hands you every job a plugin used to hide.

That's fine if you plan for it. Put the SEO fields in the schema before the first page ships. Render on the server. Let the CMS drive the sitemap. Lock previews like they hold secrets, because they often do.

Teams that skip this don't lose rankings on launch day. They lose them slowly, one missing field and one dev ticket at a time.

FAQ

Is a headless CMS bad for SEO?

No. A headless CMS is neutral. It stores content and hands it to your front end. SEO goes wrong when the front end renders pages in the browser, or when the content model has no fields for titles, canonicals and noindex. Server-render the pages and put SEO fields in the schema, and a headless site can rank as well as any other.

Do I need an SEO plugin for a headless CMS?

Not in the usual sense. Plugins work on themes, and a headless CMS has no theme. You build the same job in two places. The content model holds the SEO fields editors fill in. The front end reads those fields and writes the title, meta description, canonical and robots tags into the HTML on the server.

How do I make a sitemap with a headless CMS?

Generate it in the front end from the CMS API. List only published, indexable pages, with full URLs. Set lastmod from a field that changes only on real content edits. Then have the CMS publish webhook rebuild or revalidate the sitemap, so new pages show up within minutes, not at the next full build.

How do I stop preview pages from getting indexed?

Serve previews only to people with a secret cookie or token, and send a noindex header on every preview host. Vercel adds that header to preview deployments by default, but not to a custom domain like staging.example.com. Check each host with a quick header request before launch, and again after any domain change.

Should a headless site use server-side rendering or static pages?

Use static pages for content that changes a few times a day or less, like posts and landing pages. Rebuild one page when it changes, through a publish webhook. Use server rendering for pages that change on every visit. Avoid pages that only build their content in the browser, because some crawlers never run that script.

What SEO fields should a headless content model include?

At minimum: SEO title, meta description, slug, canonical override, a noindex toggle, social image, alt text on every image, a last significant update date and a field for old slugs that need redirects. Make the title and description required, with length limits, so editors can't publish a page without them.

More like this

Startup? Let's talk.

20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.