23% of Salesforce accounts contain duplicates. That number comes from the org audits we've run — every org we've scanned has had it. Usually worse than expected.
Duplicates don't just make reports look wrong. They inflate your pipeline figures, confuse sales reps about which account to work, break email routing, corrupt lead scoring models, and trigger compliance issues if the same contact gets multiple marketing touches they didn't consent to. The longer you leave them, the harder they are to clean up — because every new duplicate further entangles with existing records.
This playbook covers detection, prevention, and cleanup: matching rules, duplicate rules, batch merge jobs, manual merge, and the automation strategy that keeps duplicates from coming back.
Why Duplicates Accumulate in the First Place
Before building a cleanup strategy, understand the source. Most orgs have duplicate entry happening simultaneously from multiple directions:
- Manual entry without enforced uniqueness. A rep creates a new Lead from a trade show badge — same company spelling variation as an existing Account. No guard prevents it.
- Import jobs without deduping. A data migration or campaign import creates thousands of records. If there's no dedupe step pre-import, the duplicates are in before the first rep touches them.
- Web-to-lead forms without form-level dedup. The standard web-to-lead doesn't check for matching email before creating a new record. A contact filling out a form twice creates two Leads.
- Integration sync drift. An ERP or marketing platform sync creates a new Contact that matches an existing one. If the sync doesn't check for existing records first, it creates rather than matches.
- CRM mergers and acquisitions. When two companies consolidate Salesforce orgs, duplicates are guaranteed. The challenge is mapping which records in the new merged org represent the same real-world entity.
Cleanup without source control is a treadmill. You merge 500 pairs this quarter. Next quarter you have 600 new duplicates. Fix the sources first.
Detection: Matching Rules and Duplicate Rules
Salesforce's duplicate management lives in two places: Matching Rules (what counts as a match) and Duplicate Rules (what happens when a match is found). You can't use Duplicate Rules without a Matching Rule first.
Matching Rules — Defining What "Duplicate" Means
Matching rules are object-specific. You need one per object (Account, Contact, Lead). They define the criteria Salesforce uses to evaluate whether two records are potential duplicates.
To create a Matching Rule: Setup → Data → Matching Rules → New. Select your object.
Key configuration options per object:
| Field | Match Type | Use Case |
|---|---|---|
| Exact | Best single-field match for Contacts and Leads. Exact match catches most duplicates. | |
| Name (Company or Last Name) | Fuzzy (Similar) | Catches spelling variations: "Acme Corp" vs "Acme Corporation" vs "ACME CORP." |
| Phone | Exact or Normalized | Normalized strips formatting (+1, -, spaces) to match (415) 555-0100 with 4155550100. |
| Website | Exact | High precision for B2B Accounts. Strips http:// and trailing slash. |
| Address fields | Fuzzy or Zip+4 | For consumer contacts. Less useful for B2B orgs. |
Matching accuracy threshold: Each matching rule has a "Match Accuracy" slider. Set it low (60%) and you catch more potential duplicates but generate more false positives. Set it high (95%) and you only catch exact matches. For most orgs, 80–85% is the right starting point.
Duplicate Rules — What Happens When a Match Fires
Once you have a Matching Rule, you create a Duplicate Rule to control behavior. Duplicate rules can:
- Block creation — users see a warning or error and can't save the potential duplicate (only available with Salesforce大同 duplicate management add-on, not in Essentials).
- Allow creation with alert — the record saves, but the user sees a duplicate alert banner. They can still proceed.
- Report on duplicates — log the match to the Duplicate Record Set object for reporting.
Standard orgs without the duplicate management add-on: Your options are "Allow" (create + alert) or "Report only." Block is not available. Design your process accordingly — your goal is to catch duplicates, surface them to reps quickly, and give them an easy path to merge rather than fight a block they can bypass.
Finding Existing Duplicates: Reports and SOQL
Before you clean anything, measure the scope. Use the Duplicate Record Set report type to see what Salesforce has already flagged:
Built-in report path: Reports → All Reports → Administrative → Duplicate Record Sets.
If you've never run duplicate management before, that report will be sparse — Duplicate Rules catch new duplicates as they're created, not retroactively. For a retroactive scan, use SOQL:
-- Find potential duplicate Contacts by email (exact match)
SELECT Email, COUNT(Id) record_count, MAX(CreatedDate) newest
FROM Contact
WHERE Email != null
GROUP BY Email
HAVING COUNT(Id) > 1
ORDER BY COUNT(Id) DESC
For fuzzy name matching, you need the full-text search or a tool like Luxera Cloud's Data Scanner which applies matching logic to your full contact and account dataset and surfaces the duplicate clusters with field-level detail.
The Merge Process: Step by Step
Once you've identified duplicates, merging follows a specific sequence to avoid data loss.
Step 1: Identify the Master Record
Every merge has a "master" record — the one that survives. The rest are absorbed. The master should be:
- The record with the most activity history (emails logged, tasks completed, Opportunities attached)
- The record with complete data in key fields
- The record that isn't already linked to other records you can't relink
Never pick the newest record as master just because it's newest. Newer records are often imported duplicates with less history. The master should be the record with the most Salesforce relationship weight.
Step 2: Merge in Salesforce
For standard objects (Contact, Account, Lead), Salesforce has a built-in merge interface:
- Open the master record
- Click the down-arrow next to the record name → "Merge Duplicates"
- Search for records to merge by name/email
- Select up to 2 duplicates (Salesforce allows merging up to 3 records total)
- For each field, pick which value wins — highlighted in blue is the master record's value
- Click "Merge"
The system confirms the merge is irreversible. Once done, the duplicate records are deleted and the Duplicate Record Set is updated with the outcome.
Step 3: Merge Custom Objects via Apex
Custom objects don't have a built-in merge interface. For custom object duplicates, you need a custom merge page or an Apex handler. The logic:
// Pseudocode for custom merge
// 1. Identify master record (most relationships)
// 2. Transfer all child records from duplicate to master
// 3. Update field values: prefer master record's fields, fill blanks from duplicate
// 4. Delete duplicate record
// 5. Log merge in a custom Merge_Log__c object for audit trail
If you have a large volume of custom object duplicates, automate this. Build the handler once, run it in batches via Anonymous Apex, audit the results.
Batch Merge: Handling Scale
When you have hundreds or thousands of duplicates — which is common after a botched import or org migration — manual merge is not practical. You need batch merge.
Standard Batch Merge
Salesforce provides a Duplicate Record Management batch merge (Setup → Data → Duplicate Management → Mass Merge Duplicates). You can select a Matching Rule, find all record sets flagged by that rule, and merge them in batch. The system merges all clusters for that rule in a single operation.
Limitation: The standard batch merge works with the Duplicate Record Sets that Salesforce creates when Duplicate Rules fire. If your duplicates predate your Duplicate Rules, they won't be in record sets — you need to create them first by running a duplicate job.
Duplicate Jobs: Catching Retroactive Duplicates
To scan your existing data and create Duplicate Record Sets retroactively, run a Duplicate Job:
- Setup → Data → Duplicate Management → Duplicate Jobs
- Click "New Job" → select the object and Matching Rule
- Choose "Find Duplicates" or "Find and Report Duplicates"
- Run the job. For large orgs (100k+ records), it can take hours.
Once the job completes, you have Duplicate Record Sets for all existing matches. You can then batch-merge from there.
Prevention: Stopping Duplicates at the Source
Cleanup without source prevention is a permanent cleanup crew. Once you've cleared the backlog, stop new duplicates from entering with these controls:
Enforce Unique Fields
On any field that should be unique per object (Email on Contact and Lead, Account Number on Account), mark it as unique in the field definition. This prevents duplicates at the API and UI level — the save fails with an error before the record is created.
To set: Object Manager → Field & Relationships → select field → Set Unique checkbox.
Web-to-Lead with Pre-Existing Check
Standard web-to-lead creates a new record for every submission. To prevent duplicates from form entries, you have options:
- Salesforce Classic Web-to-Lead: Doesn't have a pre-existing check. Add a CAPTCHA or duplicate-blocking middleware on your form.
- Embedded Signup / Web-to-Lead with duplicate management: If you have the duplicate management add-on, the duplicate rules fire on web-to-lead creation and can block or flag the submission.
- Custom form with API check: Before creating a Lead via API, query for an existing record with the same email. If found, return the existing Lead ID rather than creating a new one.
Data Loader and Import Deduplication
Every data load is a duplicate risk. Before any import:
- Run the import file through a dedup step — match on email, name+zip, or company+phone — and mark the duplicates for review rather than importing both
- Use the upsert operation with an external ID field rather than insert where possible — upsert updates rather than creates if the external ID matches
- Set up a staging object to review flagged records before they go into production
Luxera Cloud Scanner: The Data Quality Scanner can ingest CSV exports from Salesforce and surface duplicate clusters before you run a second migration or import. It flags email dupes, name variations, and similar records across Account, Contact, and Lead objects.
Ongoing Monitoring: Keep the Number at Zero
Once cleaned, duplicates stay clean with three monitoring practices:
- Weekly Duplicate Record Set review. Run the Duplicate Record Sets report weekly. Each set represents a duplicate that made it past your rules — investigate whether the source needs a rule adjustment.
- Monthly matching rule review. Matching rules decay — as your org changes (new business units, new data sources), the field combinations that indicate a duplicate shift. Review quarterly.
- Quarterly SOQL audit. Run the email grouping query every quarter to catch new accumulation before it becomes a large cleanup project.
Scan Your Org for Duplicates in Minutes
Upload your Salesforce data export and get a full duplicate cluster report — by email, name, and account — with record counts and field values for each duplicate group. Free.
Run the Free Duplicate Scanner →Frequently Asked Questions
Can I merge more than 3 records at once in Salesforce?
No. Salesforce's standard merge allows 2 duplicates plus the master (3 total). For custom objects, you can build an Apex batch merge that handles larger clusters — merge N duplicates into one master in batches of 50–100 records per transaction to stay within governor limits.
What happens to the activity history when records are merged?
Activity history (Tasks, Emails, Events) attached to the duplicate records is preserved and becomes attached to the master record after merge. Activity history is transferred, not lost. However, Opportunities and Cases that were related to the duplicate record stay linked to that record — when it is deleted, those opportunities and cases may become orphaned or need relinking. Always run the "Related Records" report on the duplicate before merging.
How do I find duplicates across different objects (e.g., a Contact that matches a Lead)?
Standard Duplicate Rules are object-specific — they compare Contact to Contact, Lead to Lead. To catch cross-object duplicates (same person as both a Lead and a Contact), you need a custom solution: a nightly batch job that queries Leads and Contacts with matching email addresses and surfaces the pairs for manual review. This is one of the most common duplicate sources that standard rules miss.
Will enabling Duplicate Rules slow down data entry?
Minimal impact. The duplicate check runs asynchronously in the background when a record is saved. The save itself is not delayed. The user sees a duplicate alert banner after the save completes if a match is found.
Can I undo a merge?
No. Merging is permanent in Salesforce. The duplicate record is deleted and cannot be recovered from the UI. If you need a safety net, run the Merge Audit Trail report before merging large batches — it logs what was merged and what values won. For critical merges, export the data as a CSV backup before running batch operations.
What's the right deduplication strategy for a recently-merged org?
Start with the email field on Contacts and Leads as your primary matching key. Run a Duplicate Job to create record sets retroactively. Batch merge all clusters. Enforce email uniqueness on both Lead and Contact to prevent recurrence. Set up a monthly review cadence and a custom cross-object duplicate batch to catch Lead-Contact matches that object-specific rules miss.
Start the Cleanup Before the Data Gets Worse
Duplicates compound. Every month you wait, more records link to more opportunities, more cases, more activity history. The cleanup gets harder and the risk of accidentally breaking a relationship during merge goes up.
The right sequence: scan first, understand scope, clean systematically, then enforce prevention controls. Don't skip the prevention step — it's the only thing that makes the cleanup worth doing.