Creating and Editing Routes
Creating a new Route
- In Sanity Studio, open Routes in the document list.
- Create a new Route document.
- Set a name.
- This is an internal label to help your team identify the Route in Studio.
- Visitors do not see this value.
- Choose a layout.
- The layout is the most important decision because it determines the frontend template used to render the URL.
- For standard content pages, the default content-block layout is typically used.
- Add at least one path under paths[].
- Set the URL value (must start with / and cannot contain spaces).
- Under pages[], add a page entry and select an existing Page document.
- Review sitemap and robots settings for that path.
- Optional: configure navigation override.
- Enable the navigation override if this URL should use a different header navigation than the site default.
- Optional: configure SEO override.
- Enable the Route-level SEO override if you want to set SEO values at the Route level instead of inheriting them.
Editing an existing Route
You can safely update most Route fields after creation:
- Layout: Can be changed, but this is a significant change because it swaps the entire rendering template.
- Paths: Can be added, removed, or reordered.
- Page assignment: The Page referenced by a path can be swapped to a different Page.
- Navigation and SEO overrides: Can be turned on or off at any time.
Important constraints and behaviors
Pages must already exist
In most setups, Route editors cannot create a new Page document directly from the Route editor. Pages must be created first, then referenced by the Route.
URL path validation
Path values are validated to keep URLs clean and predictable:
- Must start with a forward slash (/)
- Cannot contain spaces
Recommended workflow
- Create or update the Page content first.
- Then create or update the Route to assign the Page to the correct URL path and layout.