Issues with renaming and deleting tags in sanity-plugin-media

4 replies
Last updated: Feb 13, 2025
The "sanity-plugin-media" plugin claims in the documentation

You can create, rename and delete tags from directly within the plugin itself
But does not give any instructions on how to rename or delete tags -- it's clear/obvious how to create new tags and how to change what tags are on the individual asset, but what if I want to remove a tag entirely?
AI Update

You're right that the documentation mentions you can "create, rename and delete tags from directly within the plugin itself," but unfortunately, the official README doesn't actually explain how to do this. This is a genuine documentation gap.

Based on the official GitHub repository, the plugin does allow tag management, but the specific UI steps aren't documented. Here's what we know:

What the documentation tells us:

The README confirms that:

  • Tags are stored as documents of type media.tag in the opt.media namespace
  • You can create tags within the plugin
  • The plugin is designed to handle tag deletion properly (removing weak references from assets)

What's NOT documented:

The actual user interface steps for renaming or deleting tags aren't provided in the official documentation. This appears to be an oversight – the feature is mentioned but not explained.

What you should try:

Since the feature is mentioned as existing, look for tag management controls within the plugin interface itself. Common patterns in media management plugins would suggest checking:

  • A tags panel or sidebar when viewing your media library
  • A filter/search area where tags are displayed (look for edit icons or right-click menus)
  • Settings or configuration areas within the plugin tool
  • Context menus when clicking on individual tags

Important warning from the docs:

The README's FAQ section does emphasize that you should not delete tags through the Desk/Structure tool. The media.tag document type may appear in your studio, but deleting tags that way will leave orphaned weak references on your assets. Always use the plugin's built-in interface for tag management to ensure references are cleaned up properly.

If you can't find the UI:

If the tag management interface isn't apparent after exploring the plugin, this would be worth raising as an issue on the GitHub repository – either to request better documentation or to report that the feature might not be working as described. Based on your search terms matching common questions, it seems others have encountered the same confusion, so clarifying the documentation would benefit the whole community.

The disconnect between the feature being advertised and the lack of instructions on how to use it is frustrating, and you're not alone in experiencing this!

Should be able to access your tags list and delete it with one of the tooltip actions.
You'll probably need to make sure all your assets are untagged first.
Hm, that button doesn't show up for me, maybe I need to yarn upgrade or something
AFAIK there's no tags on any of my assets, I created my first test tag today and then wasn't able to delete it
Found it, thanks! I think I was on an outdated version

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.

Was this answer helpful?