How to delete all images within a folder?

You can use the Admin API to delete all resources contained within a specific folder (including sub-folders).

Here's an example (in Node.js):

cloudinary.api.delete_resources_by_prefix('my_folder/', function(result){});


UPDATE
Note that you can also bulk select resources in the media library and delete them, e.g., by clicking the first image's checkbox, hold the SHIFT button and check the last image, then click the "Delete selected items" icon.

 

Note that if you have those images backed up, this will only delete the original images. For deleting backed up resources, please contact our support team and we'll be happy to assist.

Have more questions? Submit a request

Comments

  • Avatar
    Narayanan Raghavan

    Can you show us an example in Java?

  • Avatar
    Lei Wang

    It (api.deleteResourcesByPrefix) does not work with Scala to delete a folder. Only "image" and "raw" can be defined to the resourceType. Does anyone have any idea?

  • Avatar
    Maor Gariv

    Hi,

    Sorry for the very late reply, we have noticed that this request was left unattended. I guess this is not relevant anymore but for future reference -
    deleteResourcesByPrefix is meant to delete resources within a certain folder. Deleting the folders is currently not supported on our SDKs (it's currently on our road map). Please note that you can delete empty folders using the console.

Powered by Zendesk