Mass Delete Scratch Org

Mass delete scratch orgs

Scratch orgs are ActiveScratchOrg records in the Dev Hub, so you can query them all in the Developer Console and use "Delete Row" to remove them in one pass instead of one at a time.

How to delete multiple scratch orgs at once?

To delete a single scratch org, use the App Launcher and search for "Active Scratch Orgs". But how do you delete all of them in one click?

Delete them from the Developer Console

Open the Developer Console.

Use the Query Editor to view records from the ActiveScratchOrg object.

sql
SELECT Owner.Name, CreatedDate, Id, Name, SignupUsername, SignupInstance, ScratchOrgInfo.LoginUrl, OrgName
FROM ActiveScratchOrg
ORDER BY CreatedDate ASC

Select which rows you would like to delete and click "Delete Row".

Deletion is an asynchronous process, it should take less than 30 seconds.

Click "Refresh Grid" to see the current status.

Transcribed by hand from the original slide. Plain-text version of the whole catalog