Prompt

How do I let editors preview content before publishing in a headless CMS?

Technology / Developer Tools1 observationLast seen Oct 20, 2026

Latest observation

Oct 20, 2026OpenAI APIWeb search: off

To let editors preview content before publishing in a headless CMS, you usually set up a draft/preview workflow that exposes unpublished content to authenticated editors only.

Typical approach

1. Keep drafts separate from published content

Most headless CMSs support:

  • Drafts / unpublished entries
  • Published entries
  • Sometimes versioning

Editors work on drafts until they’re ready to publish.

2. Add a preview mode in your frontend

Your frontend app should support a route or mode like:

  • /preview/...
  • ?preview=true
  • a special preview session

When preview mode is active, the frontend fetches draft content instead of only published content.

3. Use a secure preview token or auth check

To prevent public access to drafts, gate preview access with one of these:

  • Preview token issued by the CMS
  • Editor authentication via login
  • Signed URL / JWT with short expiration

The frontend sends this token to the CMS API to request unpublished content.

4. Configure the CMS API for draft access

Many CMS APIs support queries like:

  • status=draft
  • published=false
  • version=draft
  • includeDrafts=true

In preview mode, your frontend uses those parameters; in normal mode, it only requests published content.

5. Redirect editors to the preview URL

In the CMS, add a “Preview” button that:

  • Generates the preview link
  • Includes a secure token or session
  • Opens the frontend page showing the draft

6. Handle cache carefully

If you use CDN or static generation:

  • Avoid caching preview responses publicly
  • Make sure draft pages are server-rendered or fetched dynamically
  • Separate preview and production cache keys

Common implementation patterns

Pattern A: Preview by token

  1. Editor clicks preview in CMS
  2. CMS generates a one-time or short-lived token
  3. Frontend receives token and fetches draft content
  4. Token expires after a short time

Pattern B: Preview by logged-in editor

  1. Editor signs into your app/CMS SSO
  2. Frontend checks user role
  3. If user is editor, allow draft fetches

Pattern C: Webhook-triggered draft preview

  1. Editor saves draft
  2. CMS sends webhook to your app
  3. App updates preview environment or draft rendering

Example flow

  • Editor writes article in CMS
  • Clicks Preview
  • CMS opens https://site.com/preview/article-slug?token=abc123
  • Frontend validates token with CMS
  • Frontend fetches draft content
  • Editor sees the article exactly as it will appear when published

Best practices

  • Keep preview tokens short-lived
  • Restrict preview access to authenticated users
  • Never expose draft API endpoints publicly without protection
  • Make preview content visually distinct if helpful
  • Ensure preview uses the same components/styles as production

If you want, I can show you how to implement this in a specific stack, like Contentful + Next.js, Sanity, Strapi, or Prismic.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.