function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sumant KuchipudiSumant Kuchipudi 

How can we bulk delete Content Bodies?

Hi,
I have sandbox and we are cleaning up the data for fresh loads, we were able to bulk delete records(dataloader) on Standard and Custom objects but I can't find the way to delete the Content Bodies. All these content (files) recrods childs to Accounts, I think when we delete all Accounts these Contents should have been deleted but I still see the Content Bodies in Storage Usage page.
User-added image
 
SandhyaSandhya (Salesforce Developers) 
Hi,

Refer below salesforce help article.

The steps to mass delete files from content using the dataloader are:
1. Export the ContentVersion object (do not reuse your successfile of the content upload!)
2. Don't us the ID of the ContentVersion, but use the CONTENTDOCUMENTID (which is the second column in your export file)
3. Use only those CONTENTDOCUMENTID's where "LastVersion"=TRUE

4. Than mass delete the object "ContentWorkspaceDocument". The ID you need is the CONTENTDOCUMENTID described above.

https://help.salesforce.com/articleView?id=000205918&type=1
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
                                             
Best Regards
Sandhya