Loading

Mass Delete Salesforce Files, Content Documents, and Libraries Using Data Loader

Udgivelsesdato: Jul 14, 2026
Beskrivelse

This article explains how to use the Salesforce Data Loader to mass or bulk delete Content (ContentDocument), Files, and Libraries from a Salesforce organization. This is useful when decommissioning a library, cleaning up unused content, or performing a bulk data maintenance operation.


Important: Salesforce recommends performing a full data export backup using the Salesforce Data Export feature before deleting any records. Data Loader cannot be used to export the actual files.

Løsning

Pre-requisite: Enable "Query All Files" Permission

Make sure the "Query All Files" permission is enabled for your user. This permission is not automatically enabled even for System Administrators. If it is not enabled, all Content records will not be visible to you. See steps to enable the Query All Files  permission.

Steps to Delete Content or Files Using Data Loader

  1. Log in to Data Loader.
  2. Select Export.
  3. Check "Show all Salesforce objects" and select the Content (ContentDocument) object.

Note: Deleting a ContentDocument record automatically deletes all related ContentVersion records as well.

  1. Select Id and any other desired fields, then follow the prompts to complete your export. For reference, see Exporting Data.
  2. Review the resulting CSV file to verify the Content records to be deleted. Remove any rows for files that should not be deleted. Save the file in .CSV (comma delimited) format.
  3. Return to Data Loader and click Delete.
  4. Follow the prompts to select the CSV file reviewed in step 5 and complete the deletion. For more information, see Inserting, Updating, or Deleting Data Using Data Loader.

Steps to Delete a Library

Once the content within a library has been deleted, navigate to the Library in your org to delete it.

  • In Salesforce Classic: Libraries tab > Library name > Delete
  • In Lightning Experience: Files tab > Libraries > Select the specific library > Delete
Vidensartikelnummer

000387186

 
Indlæser
Salesforce Help | Article