Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →
A screenshot showing the Data Loader interface used for a hard delete operation in Salesforce.
Admin

Is it possible to hard delete records using a data loader? | Data Loader hard delete

The short answer

Data Loader can delete Salesforce records permanently by using the Bulk API to bypass the Recycle Bin. The operation needs the Bulk API Hard Delete user permission and has to be switched on in Data Loader settings.

Key takeaways Switch on Use Bulk API and Enable Hard Delete in Data Loader settings before you attempt a permanent deletion. Check that your user profile has the Bulk API Hard Delete or Modify All Data permission. Export a full backup of the targeted records to a local drive before you run a hard delete. Clear restricted child dependencies and review validation rules, or the hard delete job fails. Set process.operation to hardDelete in process-conf.xml to run hard deletes from the command line.

Can you actually do a Data Loader hard delete?

Ever had a client ask you to wipe thousands of records without leaving a trace? Yes, a Data Loader hard delete does exactly that, with conditions attached. Most people hit the standard delete button and then wonder why their storage usage has not budged. A normal delete only moves records to the Recycle Bin. Getting them gone for good takes an extra step.

I have seen teams fight storage limits for months because their "deleted" data was still sitting in the bin for 15 days. When you are managing Salesforce large data volumes, knowing how to bypass that bin helps. This is not something to play around with, though. Once the records are gone they are gone, and no admin can bring them back.

How to set up a Data Loader hard delete

Before you go near the delete button, check your settings. The hard delete option is hidden or greyed out by default, and both your permissions and your Data Loader settings have to be right before it appears.

First, you need the "Bulk API Hard Delete" permission. It usually arrives with "Modify All Data", but double-check that on a custom admin profile. Without it, the option never shows up in the tool. You also have to enable the Bulk API inside the Data Loader settings, because without the Bulk API the hard delete operation does not exist.

Pro tip: always run a full export of the records you are about to kill. I have been in situations where a "test" delete wiped out live production data because of a messy CSV filter. Keep a backup on your local drive.

A settings panel with checkboxes controlling how a data tool processes records.

Both switches live in the same settings panel. The hard delete option stays greyed out until the Bulk API one is ticked.

Running the delete through the UI

If you prefer clicking through the desktop app, this is the workflow once the permissions are sorted.

  1. Open Data Loader and go to Settings.
  2. Check the box for Use Bulk API. This is mandatory.
  3. Check the box for Enable Hard Delete. Greyed out means a missing permission.
  4. Click the Hard Delete button on the main screen.
  5. Select your object and upload your CSV. The Record ID column is all you need.
  6. Map your fields and finish the job.

Using the CLI for automation

If you do this regularly, automate it. I have used the command-line interface (CLI) for monthly clean-up scripts and it holds up fine. Set your process.operation to hardDelete in your process-conf.xml file. The entry looks like this:

<entry key="sfdc.entity" value="Lead"/>
<entry key="process.operation" value="hardDelete"/>
<entry key="dataAccess.name" value="delete_list.csv"/>
<entry key="sfdc.bulkApiSerialMode" value="true"/>

Common mistakes with Data Loader hard delete

Referential integrity trips people up. A Data Loader hard delete does not let you ignore record relationships. Try to delete a parent record that has restricted children and the system still blocks you. It will not force anything through.

Validation rules are the other one. People forget that deletes run system logic too. If a validation rule or a trigger prevents a record from being removed under certain conditions, your hard delete fails. Work through what to check before you delete anything significant in an org and you avoid most of these headaches.

Key takeaways

  • The Bulk API is required. You cannot hard delete through the standard SOAP API.
  • It is permanent. The records bypass the Recycle Bin and an admin cannot recover them.
  • Permissions matter. You need the "Bulk API Hard Delete" user permission.
  • Backups are non-negotiable. Export your data before you run the operation.
  • Check dependencies, including master-detail relationships that might block the process.

So, should you use it? For cleaning up sandbox junk or purging sensitive data for GDPR compliance, absolutely. It is the most efficient way to keep an org lean. There is no undo button here, so start with a small batch of five or ten records to confirm your mapping and permissions are right before you pull the trigger on a million rows.

Frequently asked questions

Why is hard delete greyed out in Data Loader?

The Hard Delete button stays disabled when the Use Bulk API setting is off in Data Loader, or when your user account lacks the Bulk API Hard Delete permission. Turn on the Bulk API in settings and check that your profile has the required permissions.

What is the difference between delete and hard delete in Data Loader?

A standard delete moves records to the Recycle Bin, where they sit for 15 days before removal. A hard delete skips the Recycle Bin and purges the records permanently, so nobody can recover them.

Can validation rules or triggers block a hard delete in Data Loader?

Yes. Hard deletes still run system logic, so validation rules, triggers, or restricted parent-child relationships that prevent record removal will make the hard delete fail.

How do you automate hard delete using the Data Loader CLI?

Set the process.operation parameter to hardDelete in your process-conf.xml file.

Newsletter

One email every Tuesday

New guides, tool updates, and the release-note changes that break things.

No spam. Unsubscribe in one click.

Comments

Loading comments...

Leave a Comment