All docs pages (49)

Unused Metadata

List Apex, custom fields, inactive validation rules and flows, and unassigned permission sets that may be unused, so you can review them for cleanup.

Updated 2026-11-09

Unused Metadata lists metadata that may no longer be used, so you can review it before a cleanup. It covers Apex classes and triggers, custom fields, inactive validation rules, inactive flows and unassigned permission sets. Open Metadata → Unused Metadata. The page is titled Unused Metadata Finder.

The results are candidates to review, not a list of things that are safe to delete.

How to use it

  1. Pick a type: Apex Classes, Apex Triggers, Custom Fields, Inactive Validation Rules, Inactive Flows or Unassigned Permission Sets.
  2. For Custom Fields, choose the object in Pick an object....
  3. Click Find unused.
  4. To keep the list, click Export CSV. The file has the columns Type, Name, Id and LastModified.
  5. Click the link icon on a row to open the item in Salesforce Setup.

What you see

The results table has the item's name and its Last modified date. Above it, the page shows Candidates. For Apex and custom fields it also shows Referenced and Total scanned.

How each type is found:

  • Apex Classes, Apex Triggers, Custom Fields: items with no recorded reference in Salesforce's dependency data (MetadataComponentDependency). The table is titled Likely unused. Apex classes and triggers whose names look like test classes (for example ending in Test or Tests) are moved to a separate Likely test classes table, since tests normally have no callers.
  • Inactive Validation Rules: validation rules that are not active. The page notes they may be kept on purpose.
  • Inactive Flows: flows with no active version, which includes drafts and deactivated flows.
  • Unassigned Permission Sets: permission sets with no direct assignment to a user. In version 1.1.13 this includes sets that users get through a permission set group, so check each one's groups before you delete it: deleting a group member breaks the group. In the release after 1.1.13, group members count as in use and are not listed.

For the dependency-based types, a note above the table says the data caps at 2,000 rows and does not track every reference (reports, managed packages, dynamic SOQL). If a scan reaches the cap, the note adds that you should treat the results as partial.

What it reads and writes

Unused Metadata only reads. It runs these queries through your current Salesforce session:

  • Tooling API: ApexClass, ApexTrigger and CustomField (only items outside any managed package namespace), plus MetadataComponentDependency for the referenced set.
  • Tooling API: ValidationRule where it is not active, and FlowDefinition with no active version.
  • Tooling API: PermissionSet, leaving out profile-owned permission sets, permission set groups and managed ones; and a regular SOQL query on PermissionSetAssignment to find which have assignments.

It does not delete or change anything. Removing metadata is up to you, in Setup or your deployment tool.

Limits

  • Every list is read with a limit of 2,000 rows. For Apex and custom fields, the referenced set is read for the whole org (for custom fields, at most 2,000 references across all objects), and only that cap triggers the "partial" warning.
  • Apex classes, triggers and custom fields from managed packages are left out.
  • References the dependency data doesn't track, such as reports, dynamic SOQL or a field name built in code, make a used item look unused. Check Setup's Where is this used? and ask integration owners before you delete.
  • Test classes are detected by name only. A test class with an unusual name stays in the main list.
  • In version 1.1.13, unassigned permission sets are checked against direct assignments only (see above).