The above process failed on a collection of over 58,000 images, but iMazing for macOS did the job, at least when deleting in batches under 10,000.
Successfully deleted ~40,000 photos and videos in a single attempt via iExplorer:
- Quit Photos.app and Camera.app on iPhone
- Connect iPhone to Mac or PC via USB
- In iExplorer, click Media directory in left panel
- Open the DCIM directory and delete all ###APPLE subdirectories ("If you also need to delete your Photo Library albums synced from iTunes, you can navigate to Media/PhotoData and delete the Sync folder which has those files. Photo Stream (iCloud) files can be deleted in Media/PhotoStreamsData folder.")
- Make sure iCloud Photos is off then delete Photos.sqlite from Media/PhotoData/
- Turn the iPhone off and on
Image Capture and File Explorer are inefficient and unreliable when handling large collections.
Another method for batch deleting directly on device, via Shortcuts.app:
- Create a new shortcut.
- In "Search for apps and actions" bar, search for "Photos" then tap "Find Photos".
- Search for "Photos" again, this time tapping on "Delete Photos".
- Optional: Tap "Add Filter" → "Date Taken" → "is before" → select desired date.
- Tap the Run/Play button then tap "Delete" when prompted to confirm.
- Deleted items will be moved to "Recently Deleted"; empty in Photos.app via Albums → Recently Deleted → More (3 dots in a circle) → Delete All → Delete From This iPhone.