This Friday: Hear from Sanity + Vercel experts on AI and better personalization in e-commerce

Sanity image filename changes not reflecting on production site

10 repliesLast updated: Nov 29, 2025

I renamed a lot of product images in the studio to make them SEO compatible.Apparently the name changes aren't reflected in the transferred files of the production site though.

I have tried to redeploy clearing cache and have searched through media to check that no other files with the names ending up in production (f.e.
bc4ade6a97553e67ac0e2c336f27004c8c7cd07c-1000x1000.png
) still exist.
Are file name changes only cosmetic for the Studio or do I possibly need to take certain additional steps?
AI Update

I understand your frustration! The filename changes you're making in Sanity Studio are indeed cosmetic for the Studio interface only - they don't automatically change the actual CDN URLs that your production site uses.

Here's what's happening: When you upload an image to Sanity, it's stored with a hash-based filename (like bc4ade6a97553e67ac0e2c336f27004c8c7cd07c-1000x1000.png). This hash is based on the file's content and ensures cache efficiency - it never changes unless the actual image file changes.

The Solution: Vanity Filenames

Sanity supports what's called "vanity filenames" for SEO purposes. You can append your SEO-friendly filename to the end of the hash-based URL, and it will still work perfectly!

The format is:

https://cdn.sanity.io/images/<projectId>/<dataset>/<hashedFileName>/<your-seo-filename.png>?<params>

For example:

https://cdn.sanity.io/images/yourproject/production/bc4ade6a97553e67ac0e2c336f27004c8c7cd07c-1000x1000.png/product-name-seo-friendly.png?w=800

Implementation Steps

The beauty of this approach is that the hash portion remains unchanged (so caching works perfectly), but search engines see the SEO-friendly filename in the URL path, which is exactly what Google's image SEO guidelines recommend.

Important notes:

So to answer your question directly: yes, the Studio filename changes are cosmetic, but you can achieve your SEO goals by implementing vanity filenames in your frontend code!

Show original thread
10 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions