Last updated: Nov-12-2023
There are a number of ways to delete assets from Cloudinary:
- Use the Destroy method of the Upload API to delete a single asset. This method requires a signature to be generated on the server side.
- Use the Delete resources method of the Admin API to delete multiple assets. You can specify a set of assets to be deleted using
delete_all_resources(optionally giving a type) or Delete resources by tag. These methods require your API key and secret, so are not suitable for use in client-side code.
- Delete client-side uploaded assets using a delete token returned in the upload response that is valid for 10 minutes.
Via the Media Library:
- Select and delete assets in the Media Library.
- Delete folders and their contents in the Media Library.
- Bulk delete several assets at a time using set criteria from your Console Settings.
When you delete assets, they are immediately and permanently removed from your cloud storage. However, assets and transformed assets already downloaded by visitors to your website, might still be accessible through cached copies on the CDN if they are not invalidated. From within the Media Library, an
invalidate request is automatically included whenever you delete, rename, or overwrite media assets.
If using the Destroy or Delete resources methods, you need to set the
invalidate parameter to
true to invalidate copies of the asset on the CDN. It usually takes between a few seconds and a few minutes for the invalidation to fully propagate through the CDN. There are also a number of other important considerations when using the invalidate functionality.
Watch this video tutorial to learn more about deleting assets with a deep dive into the Node.js SDK methods.