Last updated: Aug-06-2025
OverviewIn this tutorial, you'll learn about the different ways to delete your resources from Cloudinary, including a deep dive into the Node.js SDK methods.
To follow along with the tutorial, clone the delete-assets-node GitHub repo and see the instructions in the README.
Video tutorialThis video is brought to you by Cloudinary's video player - embed your own!
You can find the code from this tutorial in
GitHub.
Tutorial contentsThis tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Delete assets using the Console   0:00 There are many ways to delete assets from Cloudinary. In the Cloudinary Console, you can delete individual or multiple assets from your Media Library, or, in the Settings, you can bulk delete many assets based on various criteria. Delete assets using the Node.js SDK   0:56 As deleting assets is a backend operation, you need to set your Cloudinary API environment variable, which you can copy from the Dashboard page in the Cloudinary Console. Paste it into a .env file, but don't submit this to version control as it contains your API secret, which should never be exposed.You can no longer access your full credentials directly from the Dashboard. Find your
Cloud nameon the Dashboard, and all credentials, including
API Key,
API Secret, and
API environment variable, on the
API Keyspage of the Cloudinary Console Settings.
Delete one asset at a time Delete an authenticated video   2:06 If the asset you want to delete is not an image or of delivery type 'upload', you need to include theresource_type
and/or type
parameters. For example, to delete an authenticated video: Invalidate the cache   2:25 Even if you delete assets from your product environment they may still be accessible if they have been delivered and are cached on the CDN. To invalidate the cache, specify invalidate: true
. Delete multiple assets at a time Delete images by public ID prefix   3:16 If all the assets you want to delete have public IDs that follow a convention (start with the same prefix), you can use the delete_resources_by_prefix
method. For example, to delete all images of type 'upload' that have a public ID starting docs/
: Delete authenticated videos by public ID prefix   3:38 To delete authenticated videos by public ID prefix, set the resource_type
to video
and type
to authenticated
as before: Delete authenticated images by public ID prefix   3:53 To delete authenticated images by public ID prefix, set the type
to authenticated
. There's no need to set resource_type
to image
as that's the default. Delete all assets of a particular type   4:10 Use the delete_all_resources
method to delete all assets matching a particular asset type and delivery type. For example, to delete all Facebook images: Delete all assets with the same tag   4:35 Use the delete_resources_by_tag
method to delete all assets that have the specified tag. By default, all images are deleted regardless of their delivery type. To delete videos, set the resource_type
to video
(as in the next example). Delete only derived versions of assets   5:09 You can delete only the derived versions of assets and keep the original intact, by setting the keep_original
parameter to true. Delete specific derived versions of assets   5:35 The resource method returns details of derived versions of assets. You can use the IDs returned for each of the derived versions in the delete_derived_resources
method to delete only those versions. Keep learning If you like this, you might also like...
Â
Â
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.
Â
âï¸ Feedback sent!
âï¸Â  ErrorUnfortunately there's been an error sending your feedback.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4