Important: Chatter posts, comments, and tracked changes do not count toward Salesforce data storage. Attached files count toward file storage. First check Storage Usage in Setup to see which storage category is near its limit. Deleting all posts will not free data storage.
Safely review posts with attachments
The following is a read-only SOQL example. It lists posts with file attachments (Type = 'ContentPost') for review; it does not delete anything.
| |
- Export candidate IDs with Data Loader or Workbench, then narrow the set by date, author, parent record, or other approved criteria.
- Check the organization’s backup and recovery plan and test the process in a sandbox. Have an administrator and the data owner review the IDs and deletion count.
- After approval, delete only the selected IDs with Data Loader. Salesforce’s documented bulk procedure also exports FeedItem IDs with
Type = ContentPostbefore deletion.
Deleting a FeedItem can hard-delete it without sending it to the Recycle Bin, so it may be unrecoverable. Deleting a post removes its attachment from the feed; whether the file remains at its original location or other shares depends on its state. Do not run an unfiltered delete on every ContentDocument or empty the entire Recycle Bin. For file-storage cleanup, use Storage Usage and review each file’s owner, shares, and impact before acting.
