A modern and resilient script to bulk-delete photos from your Google Photos library. Paste it into the developer console and let it run.
- Modern JavaScript (
async/await): Clean, readable, and easy to maintain. - Intelligent Waiting: Adapts to your network speed by waiting for content to actually load, preventing premature stops.
- Stall Detection: Automatically detects when Google temporarily blocks deletions (rate-limiting). This prevents infinite loops and the script will safely stop.
- Robust Error Handling: Fails gracefully with clear error messages.
- Centralized Configuration: All CSS selectors are in one place for easy updates if Google changes their UI.
- Navigate to photos.google.com.
- Open the Developer Console (
Ctrl+Shift+JorCmd+Option+J). - Copy the code from
delete-photos.js. - Paste it into the console and press Enter.
- Do not close the tab. The script will run until no photos are left.
- If a stall is detected, the script will stop and instruct you to refresh the page. Simply press
F5(orCmd+R), then paste and run the script again to continue.
This script is engineered to be more reliable than older alternatives that use fragile, time-based delays.
-
This Script (Modern
async/await):- Waits for content, not for time. It proceeds only when the next batch of photos is actually visible.
- Handles rate-limiting. Includes stall detection to handle Google's temporary blocks.
- The code is sequential and easy to understand, and errors are clearly reported.
-
Alternative Scripts (Legacy
setTimeout):- Use fixed delays. They break easily if the network is slow or the UI changes, causing them to fail or stop silently.
Use this script at your own risk. It performs a destructive action. I am not responsible for any data loss. It is recommended to test on a small number of photos first.
MIT