Delete every files of an item

Is there a way to delete every files of an item with a single click and without deleting the item and its metadata ?

There’s not really a way to delete all the files with just a single click. You’d have to remove them one by one.

In case someone finds this thread while looking for the same thing, below is a script I have written for this job. It might be dangerous as it doesn’t do any check. I had to run it for only 3 items so didn’t bother much but that might break things, be careful!

  # Change this value to the id of the item you want to clean
  $item_id = 12345;

  require_once "/export/www/bootstrap.php";

  $autoloader = Zend_Loader_Autoloader::getInstance();
  $application = new Omeka_Application(APPLICATION_ENV);
//    APP_DIR."/config/application.ini");

    'resources' => array(
      'theme' => array(
        'basePath' => THEME_DIR,
        'webBasePath' => WEB_THEME
  $db = get_db();
  $item = get_record_by_id('item', $item_id);
  set_loop_records('files', $item->getFiles());
  foreach (loop('files') as $file) {
    print $file->original_filename."\t".$file->filename."\n";