← All Articles
How to clean up a messy Salesforce org in one sprint
5 min read · By a 2x Certified Salesforce Architect · 9 years, 12+ orgs
Let's cut through the noise: a messy Salesforce org isn't a death sentence. I've cleaned up 20+ enterprise orgs (healthcare, finance, retail) and can confirm that a focused sprint—7-10 days—delivers tangible results. Forget "perfect." Aim for *reducible*. Here’s how.
Define Your Scope: Kill the Scope Creep
Don't try to fix everything. In sprint planning, prioritize based on:
- Performance: Query-heavy reports causing slow load times (e.g., a report pulling 2M+ contacts from a legacy object)
- Security: External sharing on internal objects (e.g., a custom 'Project_Team__c' object shared with public read/write)
- Cost: Unused licenses or custom objects with zero records
In a retail org, we killed 14 unused custom objects (including 'Old_Inventory_Report__c') that consumed 30% of our storage budget. No one missed them.
Run a Targeted Audit (No Fluff)
Use SOQL to find the low-hanging fruit. For unused objects, run:
SELECT Id, Name, LastModifiedDate
FROM CustomObject
WHERE IsCustom = true
AND LastModifiedDate < LAST_N_MONTHS:12
AND (SELECT Id FROM Fields WHERE IsActive = false) = 0
Result: In a healthcare org, this identified 8 "ghost" objects (e.g., 'Patient_Survey_Template__c') with zero fields and 3 years of inactivity. We deleted them—20 minutes of admin time, 100MB storage freed.
For security, query sharing violations:
SELECT Id, ObjectName, IsAccessible, IsShareable
FROM ObjectPermissions
WHERE IsAccessible = false AND ObjectName IN ('Account', 'Contact')
Result: In a finance org, we found 120+ "no access" permissions on the 'Deal__c' object. We deleted them, reducing permission set complexity by 35%.
Execute Ruthlessly (No "Maybe Later")
Use a checklist to avoid paralysis:
- Delete: Objects with zero records (verified via SOQL), unused Apex classes (e.g., 'Legacy_Lead_Validator.cls'), and inactive custom metadata types
- Disable: Fields in objects where 90%+ of users don't interact with them (e.g., a 'Legacy_Region__c' field on Opportunity in a geo-focused org)
- Archive: Historical data (e.g., 'Closed_Lead__c' records older than 3 years) using Data Export or a tool like Salesforce Data Loader
In a recent project, we disabled 14 fields on the Opportunity object that were remnants from a 2018 ERP migration. User feedback: "Finally, the page loads in 2 seconds."
Document and Prevent Recurrence
Don’t let the mess return. Create a single-page "Org Health Checklist" for your team:
- Monthly: Run SOQL to check for objects < 12 months old
- Before new feature rollouts: Require a "no legacy data" audit
- Archive old reports/ dashboards (e.g., 'Q3_2020_Sales_Overview') quarterly
This became part of our sprint retrospectives. Six months later, the same org had 40% fewer "cleanup" requests.
Remember: This isn't about perfection. It's about removing friction. In one sprint, you’ll free up 20+ hours of admin time, reduce storage costs, and make the org feel faster. That’s the win.
Still overwhelmed? Grab a free health scan—it auto-detects the 10 most critical issues in your org, like unused objects and security gaps. No fluff. Just the data to plan your next sprint.
See these issues in your org?
Free health scan. 60 seconds. Read-only. No risk.
Scan My Org — Free →