How to request an image from Sanity with its original filename instead of a hash

3 replies
Last updated: Jul 7, 2022
Hi, how can I request an image from Sanity with its original filename instead of a hash?
For example, I want to have a url like
instead of

I only found the
param in the docs but this doesn’t solve the problem as it’s only for downloading the file and the url would still contains the hash instead of the file name.
My goal is to have a better image URL to follow
Google Images best practices for SEO
Create good URL structure for your images: Google uses the URL path as well as the file name to help it understand your images. Consider organizing your image content so that URLs are constructed logically.
Jul 6, 2022, 10:24 AM
user T
, we currently support ‘vanity filenames’, which should be more user and SEO friendly than using the hash alone.
This lets you add e.g.
after the hashed file name at the end of an image/file URL, while the usual parameters continue working (e.g. webp format support in case of images).
General format:


The exact implementation will depend on how you currently build the image URLs, but could be a matter of querying and appending the original file name or any other field you’ve designated for these more friendly file names.
Jul 6, 2022, 12:29 PM
Thanks!! That should do the job. Wasn’t able to find this in the docs.
Jul 6, 2022, 3:41 PM
With pleasure! Sometimes things are a little buried, that’s why we are here 😉. But I think there might be a need for a guide or doc article about SEO practices … until then good building! 💪
Jul 7, 2022, 1:46 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the 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?

Categorized in