In Salesforce, we can delete mass records using the Mass Delete Wizard which can be accessed from Data Management > Mass Delete Records but there is a limitation of deleting 250 records at once using the Mass Delete Wizard and it only allows to delete Accounts, Contacts, Leads, Activities, Cases, Solutions, and Products records.
If you want to delete a high volume of records like more than 250 records then Data Loader is going to help in performing the delete operations of object records and unlike Mass delete wizard, Data Loader can access and delete records of custom objects also.
In this Salesforce tutorial, we are going to learn about the method to Delete the records using the Data loader in Salesforce.
Deleting records with Salesforce Data Loader
In Salesforce, Data Loader is a powerful tool used for importing, exporting, and deleting records. It is preferred when it is required to perform mass deletions of standard and custom object records in Salesforce. While deleting the data with data loader it is always suggested to keep the backup of data because the deletion cannot be undone.
Considerations
Below are some considerations to keep in mind when deleting records using Data Loader.
- Before initiating any delete operation, always keep a backup of the data.
- Check the dependencies on the records that you are going to delete. If the record is referred to in workflow rules, processes, validation rules, or in relationship with another object then it will not get deleted and give error.
- Make sure that you have the necessary permissions to delete records. Without the appropriate permissions, the delete operation may fail.
Delete the Records Using Data Loader in Salesforce
In this scenario, I will explain the deletion of the Records using the Data Loader for the Leads record.
To delete the record, we need to prepare a CSV file in our system and the easiest way to get the subset of records you’d like to delete is by exporting details of that object.
In this example, I have exported a few Lead records. The only column you need in the report is the Lead ID field (Record ID).
1. To export the records go to Data Loader and select Export -> select browse location for extracted records -> click Next.
2. Select the ID field, and the name field then click on the Finish button.

3. Now open that exported data in a CSV file and copy the header column and ID of the records that you have to delete.

4. Now open a new CSV file and paste the header column ID and under that paste the ID of the records that you have to delete.
After this save this CSV file from where you can access it with the data loader.

5. Now open the data loader and log in with your credentials. Then on the setup of the data loader click on the Delete button.

6. In this step, select the data object in which you have to delete records. In this example, I have selected the Lead data and then chose the CSV file that we have created above.
After this, click on the Next button.

7. In this step, we will do the mapping between the object fields and the header column in the CSV file that we have created, and for that click on the button Create or Edit a Map.
In the Mapping Dialog window click on the button Auto-Match Fields to Columns. If the field name is not auto-matched then you have to drag and drop the fields according to the CSV column headers.
After mapping, click on the OK button, then click Next.

8. In this window, select the file location for the error and success CSV files that can be accessed later. After this click on the Finish button.

9. In the warning message, click on the Yes button to proceed with the delete operation.

10. After the completion of the delete operation, we get a message of completion. Here, click on View Success if your records were successfully deleted.

Now you can view the status of success in this csv file as shown in the below image.

11. To view the deleted records, go to the setup page of Salesforce, and in the Quick Find bo,x search and then select

Now we can view the deleted records in the Recycle Bin, which means we have successfully deleted the records using the Salesforce Data loader.
In this way, we can delete the records using a data loader in Salesforce.
Conclusion
In this Salesforce tutorial, we have learned about the method by which we can Delete the records Using Data Loader in Salesforce and the steps that we have followed are applicable to delete records of any standard or custom object.
We also discussed the considerations we should be aware of to avoid unintended consequences while performing the delete operation with Salesforce Data Loader.
You may like to read
- How to Mass Delete Records in Salesforce
- How to Attach Files to the Records in Salesforce
- How to Delete Custom App in Salesforce?
- How to Upsert Data with Data Loader in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.