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:

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
Email 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.

Tip: Start with Email Exact match for Contacts and Leads. It catches the highest-value duplicates with the lowest false-positive rate. Add fuzzy name matching once email matching is stable and you have capacity to review more alerts.

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:

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:

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:

  1. Open the master record
  2. Click the down-arrow next to the record name → "Merge Duplicates"
  3. Search for records to merge by name/email
  4. Select up to 2 duplicates (Salesforce allows merging up to 3 records total)
  5. For each field, pick which value wins — highlighted in blue is the master record's value
  6. 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.

Gotcha: Merging Contacts that have different Parent Account links is destructive if you don't relink them first. If Contact A is linked to Account X and Contact B is linked to Account Y, merging with Contact B as master will move the merged Contact under Account Y. All Opportunity and Case relationships follow the Contact to its new parent Account. Run a relationship report before merging Contacts with different Account parents.

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:

  1. Setup → Data → Duplicate Management → Duplicate Jobs
  2. Click "New Job" → select the object and Matching Rule
  3. Choose "Find Duplicates" or "Find and Report Duplicates"
  4. 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.

Gotcha: Duplicate Jobs are org-level operations. If your org has many thousands of duplicate clusters, running a job on a large object (Contact, Lead) will consume significant CPU time and may time out on very large datasets. Run during off-peak hours. For enterprise orgs with millions of records, consider chunking by created date ranges.

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.

Tip: You can only set a field as Unique if it doesn't already have duplicate values in your data. Run the cleanup first, then enforce uniqueness.

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:

  1. Salesforce Classic Web-to-Lead: Doesn't have a pre-existing check. Add a CAPTCHA or duplicate-blocking middleware on your form.
  2. 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.
  3. 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:

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:

  1. 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.
  2. 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.
  3. 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.