How to view and delete images using the media plugin
I understand you're looking to view and manage all your uploaded images in Sanity! Yes, there are several ways to see and delete your images beyond just the image picker.
Using the Vision Tool to View All Images
The easiest built-in way is to use Vision, which comes preinstalled in Sanity Studio. You'll find it in your Studio's toolbar. Once there, you can run GROQ queries to see all your images:
*[_type == "sanity.imageAsset"]This will show you all image assets in your dataset. From here, you can see details like upload dates, file sizes, and references. Vision now even supports saved queries, so you can save this for quick access later.
Using the Media Library (Enterprise Feature)
If you're on an Enterprise plan, Sanity offers Media Library - a centralized, organization-wide asset management system. This provides a dedicated interface where you can:
- View all your images in a visual grid
- Sort, filter, and search assets
- Upload new assets via drag-and-drop
- Manage asset metadata and versions with custom aspects
- See which documents are using each asset
- Delete unused assets
Media Library treats assets as structured content rather than just blob storage, giving you much more control over organization and management.
Deleting Images
To delete images, you have a few options:
- Via API/CLI: You can use the Sanity CLI or HTTP API to delete assets programmatically
- Via Vision: While Vision is primarily for querying, you can identify unused assets there and use mutations to delete them
- Via Media Library: If you have access, this provides the most user-friendly deletion interface
Keep in mind that deleting an asset that's still referenced in documents will break those references, so it's good practice to check usage first.
Alternative: Structure Tool Customization
You can also customize your Studio using the Structure Builder to create a dedicated view for browsing assets, though this requires some custom configuration.
The Vision tool is your quickest path to viewing all images right now, while Media Library (if available to you) provides the most complete asset management experience similar to what you might expect from other CMS platforms.
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.