bulkDeleteFiles( )


Deletes the specified files from the Media Manager.

The bulkDeleteFiles() function returns a Promise that resolves when the files are deleted.

The deleted files are moved to the Media Manager's trash bin (TRASH_ROOT folder) unless permanently deleted. To permanently delete files, pass the permanent parameter with the value true. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.

Notes:

  • The specified files can be from different folders.
  • Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
  • Attempting to delete files that are already in the trash bin doesn't result in an error.
  • If your site contains deleted media files, the deleted media files still appear on your site as the files are still in the Media Manager (in the trash bin).
  • You can use bulkRestoreFilesFromTrashBin() to restore files from the Media Manager's trash bin.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings Services and Settings
Manage Media Manager
Manage Portfolio
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
fileIdsArray<string>Required

IDs of the files to move to the Media Manager's trash bin.

You can also pass the files' Wix media URLs. For example, ["wix:image://v1/0abec0_b291a9349a0b4da59067f76287e386fb~mv2.jpg/leon.jpg#originWidth=3024&originHeight=4032"]. Learn more in the File and Folder IDs article.


optionsBulkDeleteFilesOptions

Options to use when deleting files.

Did this help?