Quick answer
Yes — Data Loader can perform a hard delete, but you must use the Bulk API and choose the Hard Delete operation (or use the CLI with the hardDelete operation). Hard delete permanently removes records (bypasses the Recycle Bin) and requires appropriate permissions and configuration.
When to use hard delete
Use hard delete when you need to permanently remove sensitive data, clean up test records, or reduce storage usage. Because hard delete bypasses the Recycle Bin, always export and back up data first.
Requirements and restrictions
Before attempting a hard delete with Data Loader, ensure:
- You have the Modify All Data permission (or sufficient admin privileges).
- Bulk API is enabled for your org and the Data Loader is configured to use it.
- The Data Loader version you are using supports the Hard Delete option (most recent Data Loader versions do).
- Be mindful of object-specific constraints: some setup or metadata objects can’t be deleted this way, and referential integrity (master-detail relationships, required lookups) may block deletion.
How to perform a hard delete using Data Loader (UI)
Steps to hard delete records using the Data Loader desktop application:
- Export the records you plan to delete (always keep a backup).
- Prepare a CSV with the Id column for the records to remove.
- Open Data Loader and choose the Delete operation.
- Check the option to Use Bulk API (required for Hard Delete).
- Enable the Hard Delete checkbox (label may vary by Data Loader version).
- Log in, map the Id field, and run the operation. Review success and error files.
How to perform a hard delete using Data Loader CLI
You can run hard deletes in an automated way using the Data Loader command-line interface by setting the operation to hardDelete
in the process configuration. Example snippet from process-conf.xml
:
<!— Example process-conf.xml entry —>
<entry key="sfdc.endpoint">https://login.salesforce.com</entry>
<entry key="sfdc.username"[email protected]</entry>
<entry key="sfdc.password">yourPasswordAndToken</entry>
<entry key="sfdc.entity">Account</entry>
<entry key="process.operation">hardDelete</entry>
<entry key="dataAccess.name">data-file.csv</entry>
Risks and best practices
- Hard delete is irreversible via the UI — keep full exports before running it.
- Check for dependencies and required fields; deletion can fail if records are referenced by locked relationships or validation rules.
- Run deletes in smaller batches when dealing with large datasets to reduce timeout and locking issues.
- If unsure, run a soft delete first (normal Delete without Hard Delete) and verify results in the Recycle Bin.
- Salesforce Support may be able to recover data in limited cases, but recovery is not guaranteed and may be subject to retention policies.
Alternatives
If Data Loader isn’t suitable, you can use other tools or APIs that support hard deletes — Bulk API directly, Workbench (for bulk operations), or custom Apex/Bulk integrations — always ensuring they run hard delete operations explicitly.
Summary
Yes — Data Loader can hard delete records when using the Bulk API and selecting the Hard Delete operation (or using the CLI with hardDelete
). Use caution: hard deletes bypass the Recycle Bin and are effectively permanent for normal administrators.
Leave a Reply