Salesforce Mass Record Deletion: Best Methods & Step-by-Step Guide

Managing data in Salesforce inevitably requires keeping it clean, accurate, and up-to-date. Regular data cleanups involve removing duplicate records and clearing outdated data. The clean up process may require deleting hundreds of records in multiple Salesforce objects. For example, you may need to perform mass delete reports in Salesforce or mass delete leads records. The main concern here is to find the best way to do that. 

There are several methods to perform bulk delete operations in Salesforce: native tools, custom SQL or SOQL queries, and various third-party tools. In this article, we dive deep into Salesforce data deletion specifics, explore all the available mass delete methods, and demonstrate step-by-step guides highlighting best practices.

Table of contents

  1. Understanding Salesforce Data Deletion Rules
  2. Ways to Mass Delete Records in Salesforce
  3. How to Mass Delete Records in Salesforce (Step-by-Step Guide) 
  4. How to Mass Delete Salesforce Records Using Skyvia Data Loader
  5. Best Practices for Mass Deletion in Salesforce
  6. Common Errors & How to Fix Them
  7. Conclusion

Understanding Salesforce Data Deletion Rules

Salesforce records mass delete is a risky action that can potentially lead to data loss, compliance issues, or unwanted business consequences. Before doing it, you should understand how the bulk delete works in Salesforce.

Soft Delete vs. Hard Delete

Salesforce supports two types of delete operations: 

  • Soft Delete: When you delete records, they move to the Recycle Bin, and they can be restored. The records remain in the Recycle Bin for 15 days, after which they are deleted permanently. This type helps to avoid accidental deletions.
  • Hard Delete: The records are permanently removed from Salesforce and become unrecoverable. Hard deletion bypasses the Recycle Bin and is typically used when data needs to be cleared immediately for compliance or storage reasons.

Permission & Profile Considerations

Before performing data cleanup, make sure you are following the requirements:

  • Ensure the “Modify All Data” or “Delete” permissions for the relevant objects are granted.
  • Enable API access if you use tools like Data Loader, Workbench, or Skyvia Query. 

Ways to Mass Delete Records in Salesforce

Let’s overview several options for Salesforce mass delete. All of them are helpful for different needs and levels of technical expertise.

Mass Delete Wizard

Salesforce includes a built-in mass delete records tool in the Setup menu. The tool enables the mass deletion of Salesforce accounts, contacts, leads, and cases. It doesn’t support custom objects bulk deletion and is limited to 250 records per operation.

Pros

  • Easy to use
  • No installation required
  • Supports standard objects

Cons

  • Limited to 250 records per operation
  • Does not support custom objects
  • Lacks advanced filtering options

Best for

Users who need a simple, built-in solution to mass delete records in standard objects.

Salesforce Data Loader

Data Loader is a client application that enables bulk deletion using CSV files. Users export the records they want to delete, list their IDs in a CSV file, and then use Data Loader to process the deletions. This method requires installation and setup.

Pros

  • Supports both standard and custom objects
  • A free tool provided by Salesforce

Cons

  • Requires manual file preparation
  • Needs installation on a local machine

Best for

Advanced users who need to bulk delete large volumes of data, including custom objects.

SOQL or SQL Query 

Another method of Salesforce mass delete using SOQL or SQL queries. You can write a custom SOQL command in Workbench or use Skyvia Query to manage Salesforce data using SQL.

Workbench (SOQL)

Workbench is a web-based tool that allows users to write SOQL queries to find and delete records. It requires a solid understanding of SOQL, which is helpful for Salesforce administrators or developers.

Pros
  • Supports complex queries
  • Enables customization
  • Available online
Cons
  • Requires SOQL knowledge 
  • Not embedded in Salesforce UI
Best for

Users who are comfortable with queries. 

Skyvia Query (SQL)

Skyvia Query, on the other hand, allows users to execute SQL queries against Salesforce data. It supports deleting records in standard and custom objects, and requires no installation. Skyvia Query offers a visual query builder for non-tech users. Its drag and drop interface can help you  generate complex queries even without deep SQL knowledge.

Pros
  • Supports complex queries
  • Enables customization
  • Cloud-based and user-friendly
Cons
  • May require basic SQL knowledge for complex queries.
  • Not embedded in Salesforce UI
Best for

Users who want more flexibility and look for customization opportunities.

Apex Code for Mass Deletion

Another method to delete records in bulk is for those comfortable with coding. You can run Apex scripts in the Salesforce Developer Console. This method provides flexibility and customization options but requires developing skills.

Pros
  • Highly customizable
  • Can automate deletions
Cons
  • Requires developer expertise
  • High potential for mistakes if not carefully implemented
Best for

Developers who need full control and automation over the deletion process.

Third-Party Apps & Automation Tools

There are a number of tools provided by third parties that can solve data clean-up tasks. Besides the mass delete feature, these tools often include additional functions like data deduplication, synchronization, and backup.

Pros
  • More features than built-in Salesforce tools offer
  • Supports advanced filtering and automation
Cons
  • Some tools require paid subscriptions
  • Can have a learning curve
Best for

Businesses that need advanced deletion features and automation beyond Salesforce’s native tools.

Methods Comparison

We compared all the methods in the table below for your convenience. 

MethodEase of UseRequires CodingFeaturesBest For
Mass Delete WizardEasyNoBuilt-in tool, limited to 250 recordsDeleting a small number of standard objects
Salesforce Data LoaderModerateNoSupports both standard and custom objectsDeleting large volumes of data via CSV files
Workbench (SOQL) & ModerateYesSupports complex filtering and bulk deletionUsers comfortable with queries
Skyvia Query (SQL)EasyNoQuery builderUsers looking for flexibility and customization
Apex Code for Mass DeletionComplexYesFully customizable, high automation potentialDevelopers who need full automation control
Third-Party Apps (e.g., Skyvia, Cloudingo, DemandTools)EasyNoAutomation, deduplication, scheduled deletionsBusinesses needing advanced features

Let’s look at some of them in detail. Below, you will find the step-by-step guides on mass delete in Salesforce. 

How to Mass Delete Records in Salesforce (Step-by-Step Guide) 

In this section, we demonstrate the methods of bulk delete in step-by-step guides. 

Method 1: Salesforce’s Mass Delete Wizard

The easiest way to bulk delete Salesforce records is a mass delete wizard. It’s a built-in tool available in Salesforce Classic and Lightning. 

To mass delete Salesforce contacts, accounts, or other standard object records, follow the below steps:

  1. Go to Setup.
  2. Look for ‘Mass Delete Records’ In the Quick Find box. 
  3. In the Mass Delete Records window, select whether to delete accounts, activities, contacts, cases, leads, products, or reports.
Salesforce setup mass delete records
  1. Indicate the criteria for the records to be deleted and click Search.
  2. On the list of found records, select the needed records and click Delete.

This method is quite easy and fast. However, the maximum number of records to remove at once is 250, so it might be necessary to perform dozens of such operations to eliminate thousands of records. This is not convenient and is usually time-consuming, so using alternative services becomes inevitable in such cases.

Method 2: Salesforce Data Loader

This method is helpful in the following cases:

  • To delete a large number of records. 
  • For bulk delete Salesforce records in objects not supported by Mass Delete Wizard.
  • To schedule regular data deletions. 

Data loader supports other operations besides deletions. You can also use it to import data.

Salesforce Data Loader

Prerequisites

Before using Data Loader, ensure that the API is enabled and that the appropriate user permissions are granted in Salesforce. 

If you perform bulk hard delete, enable the Bulk API Hard Delete for your organization.

Downloading and installing Data Loader

To start using the Salesforce Data Loader, perform the following steps. 

  1. Install Java Runtime Environment (JRE) version 17 or later for your operating system.
  2. Download the most recent version of Data Loader at https://developer.salesforce.com/tools/data-loader.
  3. In the Data Loader folder, find and open the installation file. 
  4. Specify a folder to install the Data Loader. 
  5. Answer the prompts and select your preferences to complete the installation.

Exporting records with SOQL queries

To delete records with Data Loader, you must extract them from Salesforce first.

  1. Open the Data Loader on your computer and click Export. To export archived activity records and soft-deleted records, click Export All instead. 
  2. Sign in with Salesforce. 
  3. Choose an object. If your object name isn’t listed, select Show all objects to see all the available objects you can access. 
  4. Select the CSV file to export the data to. Choose an existing file or create a new one. The export replaces the contents if you choose the existing file.
Select Salesforce Object
  1. Create a SOQL query for the data export using only the record ID as the desired criterion.

For example, the query below selects the IDs of contacts created during the last calendar year:

Edit Salesforce Query
  1. After the operation is complete, a confirmation window will display the export results.
  2. To view the CSV file, click View Extraction or OК to close.

Deleting records in bulk using CSV files

To perform mass delete records in Salesforce, do the following. 

  1. Launch the Data Loader and click Delete.
  2. Sign in with Salesforce. 
  3. Choose the object to delete data from.
Salesforce Object
  1. Select the CSV file with the list of records to be deleted. 
  2. Map the ID fields between the selected object and the CSV file.
Mapping data
  1. Select the folder where to place the log files when the operation is complete.  

Method 3: Using Workbench

Workbench is a web-based tool that helps Salesforce developers and administrators manage data. It supports deleting large data volumes from standard and custom Salesforce objects. 

Prerequisites

Before using Data Loader, ensure API is enabled and that the appropriate user permissions are granted in Salesforce. 

If you perform bulk hard delete, enable the Bulk API Hard Delete. 

Exporting records with SOQL queries

You have to export the records to be deleted first. For this, do the following. 

  1. In Workbench, select the environment, API version, and click Login with Salesforce.
  2. Select an action to perform and Select an object. 
  3. Specify fields and set filters if needed using the visual query wizard. In this case, Workbench will generate a SOQL query automatically. You can also write your custom SOQL query. 
    • Note: The ID field is required for deletion. 
  4. Set View as to BulkCSV and click Query.
Workbench SOQL Query
  1. Download the result file. 

Deleting records in bulk using CSV files

Now you can delete records:

  1. Click Data in the top menu and select Delete.
Workbench delete
  1. Choose the file exported earlier. 
  2. Map the Id field in the Salesforce object to the Id in the CSV file and click Map fields
  3. Confirm mapping and select Confirm Delete. 

Method 4: Using Skyvia Query

Skyvia Query is an online SQL client and query builder tool for retrieving and managing cloud and relational data with SQL statements. It provides a visual Query Builder to compile queries via UI and an SQL editor for users who are familiar with SQL.

Skyvia Query

Prerequisites

To run queries in Skyvia, you need an active Skyvia account and a valid Salesforce connection. 
Not registered yet? Go for it now.

connect any data

Deleting Salesforce Records with SQL Statement

To mass delete Salesforce records using SQL command, do the following. 

  1. Go to Skyvia and click +Create New.
  2. Find Query and choose SQL. 
Skyvia Query
  1. Select the existing Salesforce connection or create a new one. Once selected, all the available objects will be displayed on the left.
Skyvia Query
  1. Type the mass delete SQL statement and click Execute.
  2. Check the result preview and click Apply All if everything is right.
    For example, the following command deletes contacts containing Test in their names:

DELETE FROM Contact WHERE Name LIKE ‘%Test%’;

Skyvia Query

Method 5: Apex Code for Mass Deletion

Apex enables users to access the Salesforce back-end to perform various data manipulation tasks and create custom applications. In terms of mass delete, Apex allows you to do simple one-time deletions or create a reusable delete script, which you can run by schedule. See below for instructions on how to run a simple one-time deletion code.

Writing a simple Apex script for bulk deletion

To delete Salesforce records using Apex, do the following.

  1. In Salesforce, click the gear icon and open Developer Console.
  2. Click Debug and select Open Execute Anonymous Window.
Developer Console
  1. Paste the script and click Execute.

For example, the script below deletes the contacts containing test in their names.

List<Contact> contactsToDelete = [SELECT Id FROM Contact WHERE Name LIKE '%Test%'];
if (!contactsToDelete.isEmpty()) {
    delete contactsToDelete;
    System.debug(contactsToDelete.size() + ' contacts deleted.');
} else {
    System.debug('No contacts found with "Test" in their name.');
}

Method 6: Using Third-Party Apps

If you are not interested in built-in tools, coding methods, and writing SOQL and SQL queries, you can always use a third-party tool for Salesforce mass delete. There are a number of third-party tools on the market. Below, we compare five top-rated tools. 

  • DemandTools is a data quality toolset for Salesforce CRM, offering functionalities such as de-duplication, normalization, standardization, comparison, import, export, and mass delete.
  • Cloudingo is a Salesforce data quality tool focusing on deduplication and data cleansing. It can detect duplicates, mass delete unwanted records, automate maintenance, and help visualize data. 
  • Skyvia is a cloud data platform that provides data integration, backup, and management solutions. It allows users to perform mass deleting Salesforce records using a user-friendly interface. It also provides diverse solutions for data manipulation and data orchestration.  
  • Insycle is a data management platform that provides an intuitive interface for Salesforce users to manage, cleanse, and delete data in bulk. It can mass delete Salesforce records, detect duplicates, automate data maintenance, and track changes for audits.
  • Dataloader.io  is a cloud-based data loader for Salesforce, allowing users to import, export, update, and delete data in bulk. 
ToolEase of UseRequires CodingBest ForAdditional Features
DemandToolsModerateNoData deduplication and mass deletionData standardization, import/export capabilities
CloudingoHighNoData cleansing and deduplicationAutomated maintenance, data quality dashboards
SkyviaHighOptional (for SQL)Mass delete operations and data integrationData integration and automation, cloud backup
InsycleHighNoMass editing and deletion tasksSupports standard and custom objects, advanced filtering
Dataloader.ioHighNoBulk data operationsScheduling capabilities, secure performance

How to Mass Delete Salesforce Records Using Skyvia Data Loader

This method helps with deleting Salesforce records via CSV files. It’s really useful for removing a huge number of records in standard and custom objects.  Below, we show step-by-step instructions on how to do it with Skyvia via Import tool. In our example, we delete accounts from Salesforce. You can also mass delete tasks leads, reports, or any other data using the same approach.

Prerequisites

To mass delete Salesforce records with Skyvia Import, you need an active Skyvia account, a valid Salesforce connection, and a CSV file with record IDs to be deleted. Explore ways to export data from Salesforce in the Skyvia blog. 

To keep your data clean with Skyvia, don’t hesitate to get a two-week trial.

Discover best pricing

Bulk Delete Salesforce Records by CSV Using Skyvia Data Loader

  1. Click +Create New in the top menu and select Import in the Integration column.
Skyvia menu
  1. Set the source type to CSV upload manually. To get a CSV file from the supported storage service, choose CSV from the storage service
  2. Select Salesforce connection as Target.
Skyvia CSV Salesforce Import
  1. Click Add new to create an import task. 
  2. Upload your CSV file. And proceed to the next step.
Skyvia Task Editor
  1. In the Target drop-down list, select the object where the records will be deleted. Then, select the Delete operation and proceed further.
Skyvia Task Editor
  1. In the last step of the task editor, map the source file columns to the target fields and save the task.
Skyvia Task Editor
  1. Save the integration and run it. Check the integration results on the Monitor and Log tabs.

Batch Remove Salesforce Contacts by Filters Using Data Loader

If the records for deleting can be received from Salesforce itself, Skyvia offers an alternative and much simpler way to mass delete them. You just need to create an import integration and select the same Salesforce connection as both the source and the target. This method doesn’t require CSV files; just do the following. 

  1. Create a new import integration from the menu. 
  2. Set the data source type as Data Source database or cloud app and select the same Salesforce connection as a Source and Target.
Skyvia Salesforce to Salesforce Import
  1. Add a new import task. Select the source object in the drop-down list and set filters if needed. For example, we delete the contacts containing ‘test’ in their names.
Skyvia Task Editor
  1. Select the target object and choose the Delete operation.  
  2. Map the fields. In our case, they are mapped automatically.
Skyvia Task Editor
  1. Save the integration and run it. You can schedule it to run automatically at a specific time or within a specific period.

In the same way, you can mass delete Salesforce accounts, mass delete Salesforce opportunities, or other records in the standard or custom Salesforce objects.

try Skyvia

Best Practices for Mass Deletion in Salesforce

When performing bulk delete in Salesforce, you must consider the importance of this operation and you have to be aware of the consequences. Define the deletion objectives and consider security concerns.  Plan the data deletion logic carefully and evaluate potential risks. We collected the best practices for mass records deletion.

  • Backup First – Always create a full backup before deleting records to prevent unrecoverable data loss. You can try secure Skyvia Backup
  • Check Relationships – Understand how deleting a record affects related objects and records.
  • Use Filters Carefully – Double-check filters before executing a mass delete to avoid accidental deletions.
  • Test in a Sandbox – Run deletions in a test environment to confirm the expected result.
  • Communicate with Teams – Inform relevant teams before performing large-scale deletions to prevent workflow disruptions.
  • Monitor Deletion Logs – Keep track of deleted records using audit logs or change tracking.

Common Errors & How to Fix Them

If something can go wrong, it will. Thus, we collected several potential problems you may face when performing bulk delete in Salesforce and added some hints to their solutions. 

ErrorCauseSolution
Insufficient permissionsUser lacks Delete/Modify All Data rightsCheck the profile permissions and update them if needed. 
API access restrictedAPI disabled for a userEnable API access in Salesforce. 
Record LockingRelated records prevent deletionCheck the records relations before deleting. Delete related records first. 

Conclusion

Mass delete of Salesforce records can be done in multiple ways, starting with built-in tools like Mass Delete Wizard and ending with third-party wizard solutions or custom SOQL or SQL commands. While some methods require technical skills, Skyvia offers a more accessible and efficient way to manage bulk deletions with minimal effort. Whether you need to clean up outdated data or remove unnecessary records, choosing the proper method will save time and help keep your Salesforce environment organized.

F.A.Q.

Can I mass delete records in Salesforce without admin access?

No. Mass deletion requires specific permissions such as “Modify All Data” or “Delete” on the object. If you don’t have the necessary permissions, you’ll need to contact your Salesforce admin.

What happens to deleted records in Salesforce?

When you delete a record, it moves to the Recycle Bin (soft delete) and can be restored within 15 days. However, if you perform a hard delete, the records are permanently removed and cannot be recovered.

Can I automate mass deletions in Salesforce?

Yes. You can use third-party tools like Skyvia, Cloudingo, or DemandTools to schedule and automate mass deletions based on predefined rules.

Can I undo a mass delete in Salesforce?

Yes, in case you performed a soft delete. You can recover your records from the Recycle Bin. In case of hard delete, the records are unrecoverable.

Olena Romanchuk
Olena Romanchuk
Olena is a skilled writer with a unique blend of technical and FMCG industry expertise. She began her career at Skyvia as a technical support engineer, where she honed her technical problem-solving skills. Prior to Skyvia, Olena held HR and IT roles in global FMCG giants such as AB InBev, Nestlé, and Philip Morris International, where she developed analytical skills, service-oriented thinking, and excellent communication to create engaging and accessible content. From a diverse and inclusive professional background, Olena excels in breaking down complex concepts and delivering clear, impactful writing tailored to varied audiences.

TOPICS

BY CONNECTORS

Skyvia podcast