/Google-Photos-Delete-Tool

This tool provides an efficient, stable, and automated way to delete multiple photos from Google Photos. It's now available as a Chrome extension for easier use, but you can also use the script injection method if you prefer. Unlike other scripts or manual methods, this tool offers several unique features.

Primary LanguageJavaScriptMIT LicenseMIT

🗑️ Google Photos Delete Tool

This tool provides an efficient, stable, and automated way to delete multiple photos from Google Photos. It's now available as a Chrome extension for easier use, but you can also use the script injection method if you prefer.

Unlike other scripts or manual methods, this tool offers several unique features:

  • 🎯 Selector-based Awaiting: Instead of using timers, this script uses selectors to await elements, ensuring optimal performance and stability across different network speeds and device capabilities.
  • 🔄 Automatic Scrolling: The script automatically scrolls through your entire photo library, eliminating the need for manual intervention.
  • 📦 Batch Processing: Photos are selected and deleted in batches, significantly speeding up the deletion process.
  • 🔢 Customizable Deletion Limit: Users can easily set a maximum number of photos to delete, providing fine-grained control over the operation.
  • 💪 Resilient to Interruptions: If the script stops unexpectedly, it can be restarted and will continue from where it left off.

This improved version offers a more reliable and efficient solution for users looking to manage large numbers of photos in their Google Photos account.

🚀 Performance

Our Google Photos Delete Tool significantly outperforms manual deletion and other available scripts. Here's how it stacks up:

⚡ Speed Comparison

Method Photos Deleted per Minute
Manual Deletion ~20
Average Script ~100
Our Delete Tool ~500*

*Actual performance may vary depending on your internet connection and computer specifications.

📊 Performance Metrics

  • Batch Size: Deletes up to 500 photos in a single batch
  • Scroll Speed: Processes approximately 1000 photos per scroll
  • Error Handling: Automatically retries failed deletions, ensuring over 99% success rate

🏆 Key Advantages

  1. 5x Faster: On average, our tool deletes photos 5 times faster than typical scripts and 25 times faster than manual deletion.
  2. Reduced API Calls: By using smart batching, we minimize the number of API calls, reducing the risk of rate limiting.
  3. Lower Resource Usage: Our selector-based approach uses less CPU and memory compared to timer-based scripts.

📈 Performance Graph

Deletion Speed (photos/minute)
|
500 |    ___________ Our Delete Tool
    |   /
400 |  /
    | /
300 | /
    |/
200 |/
    |    ___________ Average Script
100 |   /
    |  /
 0  |_/_____________ Manual Deletion
    0   5   10   15   20   25   30
              Time (minutes)

Our tool maintains high performance even with large libraries, whereas manual deletion becomes increasingly time-consuming.

📋 Table of Contents

🔍 Prerequisites

⚡ Optimizing Performance

To significantly speed up the deletion process for both the Chrome extension and script injection methods, we recommend blocking image loading:

  1. 🚫 Disable image loading for Google Photos on your browser to avoid high CPU, RAM, and network usage:

    • On Chrome:
      1. Click on the site padlock (the lock icon along the URL bar) -> Site settings
      2. Block images in the Permissions for the website

    Image Blocking in Chrome

  2. Reload Google Photos after applying this setting.

This step can dramatically improve the tool's performance by reducing the amount of data that needs to be loaded.

🚀 Method 1: Chrome Extension (Recommended)

Installation

  1. Clone this repository or download it as a ZIP file:

    git clone https://github.com/shtse8/google-photos-delete-tool.git
    
  2. Open Google Chrome and navigate to chrome://extensions/

  3. Enable "Developer mode" by toggling the switch in the top right corner

  4. Click on "Load unpacked" and select the chrome-extension folder from the cloned/downloaded repository

  5. The Google Photos Delete Tool extension should now appear in your Chrome extensions

Usage

  1. Navigate to Google Photos

  2. (Optional but recommended) Apply the image blocking step from the Optimizing Performance section

  3. Click on the Google Photos Delete Tool extension icon in your Chrome toolbar

  4. The tool will automatically start selecting and deleting photos based on the default settings

  5. Monitor the progress through the browser console (press F12 to open Developer Tools, then select the Console tab)

  6. The process will continue until it reaches the set limit or runs out of photos to delete

💻 Method 2: Script Injection

Usage

  1. 🔐 Login to your Google Account.

    Google Account Sign-in Page

  2. 📸 Go to Google Photos

    Google Photos Page

  3. Apply the image blocking step from the Optimizing Performance section

  4. 🛠️ Open Developer Tools. You can do this by:

    • Keyboard Shortcut: Press CTRL + SHIFT + I
    • From the Page: Right-click on an empty area and select Inspect (last option)

    Google Chrome Right Click Pop-up Menu

    • From Menu:
      1. Click on the menu button Google Chrome Menu Icon on Google Chrome
      2. Select More tools
      3. Select Developer tools

    Google Chrome Menu Developer Tools

  5. 💻 After opening the developer tools, click on the Console tab.

    Google Chrome Console on Google Photos page

  6. 📋 Copy all the code from the delete_photos.js file and paste it into the console.

    The Code in Chrome Console

  7. ▶️ Hit ENTER after pasting the script in the console. The script will start running upon hitting the ENTER key.

  8. 🚀 The script will start selecting and deleting photos automatically. You'll see progress updates in the console.

⚙️ Customization

You can adjust the maxCount variable at the beginning of the script to set the maximum number of photos to delete. By default, it's set to 10,000.

For the Chrome extension:

  1. Open the chrome-extension/content.js file
  2. Locate the CONFIG object at the beginning of the file
  3. Modify the maxCount value to your desired limit:
    const CONFIG = {
      maxCount: 5000, // Change this number to your desired limit
      // ... other config options
    };
  4. Save the file and reload the extension in chrome://extensions/

For the script injection method:

  1. Open the delete_photos.js file
  2. Locate the CONFIG object at the beginning of the file
  3. Modify the maxCount value as shown above
  4. Save the file and use the updated script for injection

🔧 Troubleshooting

If you encounter any issues:

  1. 🌐 Ensure you're using the English version of Google Photos.
  2. 🔄 Try refreshing the page and running the script again.
  3. 🔁 If the script stops unexpectedly, you can simply run it again to continue the process.
  4. 🔍 Check the browser console for any error messages and report them if the issue persists.
  5. If using the extension, try the script injection method to see if the issue persists.
  6. If problems persist, please open an issue on this GitHub repository.

⚠️ Caution

  • 🛑 Use this script responsibly. Deleted photos may be recoverable for a limited time, but exercise caution to avoid unintended data loss.
  • 🔄 This script interacts with the Google Photos interface, which may change over time. If Google updates their UI, the script may need adjustments.
  • 💾 Always ensure you have backups of important photos before performing bulk deletions.

❓ Frequently Asked Questions

  1. Q: Is this tool safe to use? A: While the tool is designed to be safe, always use caution when bulk deleting files. Ensure you have backups of important photos.

  2. Q: Can I recover photos deleted by this tool? A: Google Photos typically keeps deleted items in the trash for 60 days. You can recover them from there within this period.

  3. Q: Why does the script sometimes pause or slow down? A: The script may slow down due to network latency or Google Photos' rate limiting. It's designed to handle these situations gracefully.

🤝 Contributing

Contributions are welcome! If you have suggestions for improvements or encounter any problems, please open an issue or submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Disclaimer: This tool is not officially associated with Google. Use it at your own risk. The developers are not responsible for any data loss or account issues resulting from the use of this script.


📌 If you find this tool helpful, please consider giving it a star on GitHub! ⭐