✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Is it possible to convert rich text to plain text using the Sanity client?

2 replies
Last updated: Apr 1, 2024
Sanity is for sure my favorite CMS ever, but one thing I really loved that I could leverage in prismic was turning rich text into plain text strings $prismic.asText(pageData.text) for instance. Is this something that is currently possible utilizing the sanity client?
Apr 1, 2024, 3:05 AM
You can do this in groq: https://www.sanity.io/docs/groq-functions#1467558a0339

"content": pt::text(content)
Apr 1, 2024, 7:01 AM
user A
wow easy easy. thank you!
Apr 1, 2024, 3:04 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?