Skip to main content
CMSquestions

How to Handle Rich Text and Block Content in a CMS

IntermediateQuick Answer

TL;DR

Rich text in a headless CMS is stored as structured block content — arrays of typed blocks (paragraphs, headings, images, custom blocks) — not raw HTML. Render it by mapping each block type to a frontend component. This structured approach enables multi-channel delivery, custom rendering per context, and extensibility with custom block types. Sanity uses Portable Text, a vendor-neutral structured content format.

Key Takeaways

  • Structured block content is not HTML — it's a JSON array of typed objects that your frontend renders into HTML (or any other format)
  • Each block type needs a corresponding renderer — missing renderers silently drop content, so always handle unknown block types with a fallback
  • Custom block types (call-to-action, product embed, code block) are first-class citizens in structured content, not HTML hacks