Get a peek at our latest innovations at Sanity Product Day on Dec 8th →

How to Automatically Generate a Slug Without Using Sanity Studio

1 replies
Last updated: Jul 6, 2022

Hello, I am trying to auto generate a slug without using sanity studio, I am making a post where the user mutates the data and then next page will show the submitted post, any ideas how I can implement this without generating the slug manually? Much appreciated.

Jul 2, 2022, 9:30 AM


user M
! You'll need to write some sort of function or use an existing package to create a slug. There aren't any options for autogenerating one when submitting content via the API.

Jul 6, 2022, 3:53 PM Get the most out of your content is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Free to get started, and pay-as-you-go on all plans. Find out more.