Via API
You can use the Admin API to bulk delete all of your Cloudinary uploaded resources in batches of 1000 resources per call.
For example in PHP, to delete all assets of resource type image (default) and type upload (default) you can do this:
$api->delete_all_resources();
You can delete only a certain type of resource, for example - Facebook fetched profile images:
$api->delete_all_resources(array("type" => "facebook"));
When there are still more resources to go through, the next_cursor
value is returned as part of the response. You can then specify this value as the next_cursor
parameter of the following call. This way you can go through the full lists of your resources.
For more information, see: http://support.cloudinary.com/hc/en-us/articles/205714121-How-do-I-browse-through-all-resources-in-my-account-using-the-API-
Note that the Admin API is rate limited.
Via UI
Bulk delete assets in the UI. In addition to bulk deletes via the API, you can execute bulk deletion jobs by going to your Account's Settings page and clicking the "Bulk delete" button from the Self-Service Operations section -
Comments
9 comments
Hi,
I am using rails app and i have executed the below command to delete all my images.
Cloudinary::Api.delete_all_resources
Even after deleting all images from my console I can still access these images through the previous URL. Though i cant see my uploaded images in Media library I dont see any changes in my storage size. Please help me on this.
While the images were successfully deleted from your account, they're still cached in the CDN.
For more information:
http://support.cloudinary.com/entries/23310776-I-have-deleted-an-image-and-though-it-has-been-removed-from-the-media-library-it-is-still-available-
so how about videos ?
When deleting either videos or raw files, a
resource_type
should be set as well. For example (in Rails):move the UPDATE right to the top of this article!
What does the "Prefix" search actually mean? Can I put a domain URL to remove all images from a particular domain?
By prefix search, we mean the first few characters of the public_id. Eg: your image is a sample, you can search by the prefix which can be "sam", "s", "samp" etc.
Is the domain URL the public_id of the image or is it the fetched resource? Can you share an example?
Thanks,
Aditi
@aditi Is the prefix applicatable only at sub account level or global level
Hi Upendra,
The bulk delete in general only works for each sub-account and does not delete your assets on a global level so you'll have to run a separate bulk delete call for each of your sub-accounts.
Please sign in to leave a comment.