A Delete in Data Loader removes records — soft-deleting them to the recycle bin, where they sit for up to 15 days before Salesforce auto-purges them. (If you want to skip the recycle bin entirely, that’s Hard Delete, a separate operation.)
Step-by-step
- Prepare the CSV. You only need one column:
Id. Every row is a record to delete. Extra columns are ignored. - Launch Data Loader and click Delete.
- Log in to production or sandbox.
- Pick the Salesforce object — must match the object the Ids belong to.
- Select the CSV file with the Ids to delete.
- Map the Id column. Auto-match works if the header is literally
Id. - Pick the success / error output directory.
- Click Finish. Data Loader streams the rows through the API in batches.
- Review
success.csv— every Id that was deleted. Reviewerror.csvfor failures.
Where do the deleted records go?
To the Recycle Bin. Users with the Recycle Bin tab can undelete them, or you can run an Export All to retrieve them via SOQL. The records age out automatically after 15 days, or sooner if the bin hits its size limit (~5,000 records per licence).
Hard Delete
If you tick Hard Delete instead of plain Delete, records bypass the recycle bin and are gone immediately. This is a permission-protected operation — see How to enable the Hard Delete option on Salesforce Data Loader? for the steps.
Where the Ids usually come from
The standard pattern is Export → filter → Delete:
- Run an Export with a SOQL
WHEREclause that returns the Ids you want gone. - Save the CSV.
- Run Delete against that CSV.
For instance, deleting test data older than 90 days might start with:
SELECT Id FROM Lead WHERE CreatedDate < LAST_N_DAYS:90 AND Test_Lead__c = true
Things that will bite you
- Cascade deletes. Deleting a parent record (e.g. Account) deletes its master-detail children automatically. The children won’t show up in your Data Loader success file, but they’re gone.
- Locked records. Records in approval, locked by validation, or referenced as required by other records will fail with messages like
ENTITY_IS_LOCKEDorDELETE_FAILED. - Trigger code.
before deleteandafter deletetriggers still fire — they can veto your deletion viaaddError. - Audit history. Deleted records lose all their detail history when the recycle bin purges them. If you need an audit trail, Export All before the delete.
Common failures
| Error | Cause |
|---|---|
ENTITY_IS_DELETED | Row was already deleted (idempotent, usually fine) |
INSUFFICIENT_ACCESS_OR_READONLY | User lacks Delete permission on that record / object |
CANNOT_DELETE_RECORDS_HAVE_RELATED_DETAIL_DATA | Record has detail records preventing deletion |
Verified against: Data Loader Guide — Deleting Data, Metadata API Developer Guide. Last reviewed 2026-05-17 for Spring ‘26 release.