A Hitchhiker’s guide to emptying your Google photos or deleting them in bulk

Vijay Balasubramanian
5 min readJul 20, 2021

If you are pretty tech-savvy and can follow a readme file — please by all means, go to this location, get the tool and get going. I am sure you’ll figure out why the tool exits sooner too. Sayanora!

If you are here to troubleshoot, go to the last for possible issues.

Disclaimer — I neither own nor maintain this tool. I used it and found it to be pretty useful and time-saving. Please use this code or any other third party tool at your own risk. I take no responsibility for anything like active volcanoes, global warming or your first born son becoming a Billie Eilish fan due to your usage of this tool.

Photo by Mitchell Luo on Unsplash

But if you are still here, please read on. I also discuss some issues and updates at the last.

So you decided to chicken out… I mean opt out of Google taking your 2 dollars every month in exchange for the 100GB storage they offer. Not to worry, it happens to the best of us.

Or you are normal person and is simply looking for a way to empty your google photos without individually selecting groups of photos and deleting them.

But right now, google being google, do not give you an easy way to backup your photos or empty your google photos on said backup.

Really it is just a 3 step process, right?

  1. Backup all your photos on another cloud of your choice or your local machine. Its 15 Gb for the free plan and 100 Gb for the paid plan, give or take.
  2. Empty your google photos.
  3. Opt-out of Google’s subscription, save the $2 and become a millionaire.

That is pretty much it, right?

Photo by Thomas Park on Unsplash

Not really. Google has no easy way to backup your photos. They only give you a lousy option called ‘Google Takeout’, which is incredibly irritating, completely user unfriendly and just downright insulting.

But I strongly recommend you do in fact use the tool and create a local backup before you do anything at all. Here is the guide, go break a leg.

Now that you’re backup is done.. or not. Lets go on and empty the Big G. This is from the readme file on the code.

## Steps

  1. Download the code from the Github repository at the top of this post.
  2. Login into your Google Account
  3. Go to Google photos. Keep it as the only open tab on the window since you may have to close and open it multiple times(reasons given in Issues section)

4. Disable image loading for Google Photos on your browser to avoid high cpu, ram and network usage

**On Chrome**

a) Click on the site padlock ( the lock icon along the url bar) -> Site settings

b) Block images in the Permissions for the website

c) Reload Google Photos

d) 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 (By default, the button is present on the top right corner of the window).

2) Select `More tools`.

3) Select `Developer tools`.

![Google Chrome Menu Developer Tools](images/chrome-menu-popup.jpg)

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

![Google Chrome Console on Google Photos page](images/chrome-console.jpg)

Note: _This console lets you run custom code, like this tool! You can learn about it on [Google Console page](https://developers.google.com/web/tools/chrome-devtools/console/)

*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.*

6) Copy all the code in the file delete_photos.js and paste it in the console.

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 `maxImageCount` as provided below:

You can also change the values of ‘Delete Cycle’ and ‘Press button delay’ according to your urgency. If you have a faster machine and internet connection, you can give a smaller value for ‘Press button delay’ and this task can be completed earlier.

7) Hit **ENTER** button after pasting the script in the console. The script will start running upon hitting ENTER key.

8) Done! Now, you should see the script delete all your photos in the batch

Do not close your browser. Also I Strongly recommend testing this for a few minutes before you let it run all through your G Photos.

Issues/Troubleshooting/errors/concerns.

Here are somethings you need to watch out for:

a) If you get an error saying something is not recognized or any other message, it probably means you are trying to run the code again since it exited. You will need to close and re-open the browser to be able to do it again. In fact every time you re-run the code, you need to open a new browser window.

b)The tool constantly exits earlier on some occasions. I haven’t figured out why this happens, but I did notice that increasing the ‘Delete_cycle’(line 15 in the file) prevents this to some extent. But in any case, if you have a few tens of thousand photos to be deleted, you may have to run this tool at least 10 times.

c) The press button delay can be kept to a very small number if you have a good machine. This makes sure that the photos are selected and deleted quicker. Usually the tool selects only a handful of photos(7–20) and deletes them. See what happens with you and then proceed.

d) The bin might get overloaded as the tool trashes more and more photos. If you want to take a second look and recover some of them, then fine. If you are clear about deleting them, empty the bin frequently. You can use the Photos app on your phone since your web version is being used.

e) The photos will stop appearing on G photos when this activity happens as we have turned it off, so don’t worry about that.

Good luck!

--

--

Vijay Balasubramanian

Product manager, builds human-centric products for …humans