Skip to main content
  1. All Posts/

google-photos-delete-tool

Tools JavaScript

Google Photos Delete All Tool

If you have ever wanted to delete your thousands of photos from the Google Photos but failed to find an easy way to do so, then this is the tool for you. This script goes through all your photos in Google Photos app on the desktop and deletes them. You can visually see the process while it happens!

Getting Started

Follow the step-by-step instructions below to run the tool.

Prerequisites

Assumptions

The manual steps assume that these steps are performed on the Google Chrome Browser. If you’re using a different browser, the steps still remain the same, however, the keyboard shortcuts or browser specific keywords may not be same for you, as described below.

Steps

  1. Login into your Google Account.
  1. Go to Google Photos

Note: If you’re logged into Google, you will see your images.
Note: You must login into English language version of Google Photo

  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
          <ol start="3" dir="auto">
            <li>
              Reload Google Photos
            </li>
          </ol>
        </li>
      </ul>
      
    • Open Developer Tools. You can do so by following either of the three options

      • Keyboard Shortcut
        Press the three keys together in the sequence – CTRL + SHIFT + I
      • From the Page
        Right click on an empty area with your mouse and select Inspect (last option)

      • From Menu

        1. Click on the menu button on Google Chrome (By default, the button is present on the top right corner of the window).
        2. Select More tools.
        3. Select Developer tools.
    • After opening the developer tools, click on the Console tab.

      Note: This console lets you run custom code, like this tool! You can learn about it on Google Console page.
      You will see a warning from Google to stay cautious. If you run code in this console that’s malicious, you could be hacked. Therefore, make sure that you only run the code that you understand.

    •   <li>
          Copy all the code in the file delete_photos.js and paste it in the console.</p> <p>
            Note: The script allows you to delete all photos or any number of photos. To delete a specific number of photos, change the value of <code>maxImageCount</code> as provided in the example. </li> 
            
            <li>
              Hit <strong>ENTER</strong> button after pasting the script in the console. The script will start running upon hitting ENTER key.
            </li>
            <li>
              Done! Now, you should see the script delete all your photos in the batch
            </li></ol> 
            
            <h1 dir="auto">
              <a rel="nofollow noopener" target="_blank" id="user-content-go-faster-option" class="anchor" aria-hidden="true" href="#go-faster-option"></a>Go Faster Option
            </h1>
            
            <p>
              Script selects and deletes photos in batches based on what can be seen in the browser at one time. To increase the amount of photos that can be seen at once, and therefore deleted per batch, zoom out.
            </p>
            
            <pre class="notranslate"><code>- **Chrome on Windows and Linux**
      
      Control-Minus to zoom out.
      
      • Chrome on Mac

        Command-Minus to zoom out.

            <h1 dir="auto">
              <a rel="nofollow noopener" target="_blank" id="user-content-debugging" class="anchor" aria-hidden="true" href="#debugging"></a>Debugging
            </h1>
        
            <p>
              The script may not work as expected in case your internet speed is considerably slow. In that case, you may want to increase the <code>DELETE_DELAY_CYCLE</code> by few thousands of milliseconds. This is to ensure that the page has refreshed before the tool tries to delete the images again.
            </p>
        
            <h1 dir="auto">
              <a rel="nofollow noopener" target="_blank" id="user-content-faqs" class="anchor" aria-hidden="true" href="#faqs"></a>FAQs
            </h1>
        
            <ol dir="auto">
              <li>
                It checks and unchecks the photos, but doesn&#8217;t delete them.</p> <ul dir="auto">
                  <li>
                    Use the <a rel="nofollow noopener" target="_blank" href="https://photos.google.com/?hl=en">english language version of Google Photos</a> and run the tool again.
                  </li>
                </ul>
              </li>
        
              <li>
                It stops after deleting some images.</p> <ul dir="auto">
                  <li>
                    Increase the <code>DELETE_DELAY_CYCLE</code> by thousands of milliseconds as described in the <a rel="nofollow noopener" target="_blank" href="#Debugging">Debugging section</a>.
                  </li>
                </ul>
              </li>
        
              <li>
                There was a delay in loading images and the tool exited.</p> <ul dir="auto">
                  <li>
                    In case this happens, you can simply paste the script again and hit enter. The script will continue doing the operation.<br /> If you&#8217;re using, you wouldn&#8217;t have to copy and paste again. If you press the up arrow key, it will load the last command that you ran in the console. Hit ENTER key and the script will start again.
                  </li>
                </ul>
              </li>
            </ol>