Delete All Saved Reddit Posts and Comments

Delete All Saved Reddit Posts and Comments

tl;dr requires python, pip, and praw get the source here:

Similar to web page bookmarks I have a bad habit of saving every Reddit post I like. I went to looking for a script that could automatically delete them all and found one from Patrick Lewery Harris.

It worked great, but needed some tweaks to:

  1. Work with my username
  2. Not risk having my password in my shell history

The original script uses argparse and doesn’t like usernames that start with a “-”, which mine does. So rather than try to fix that I just ripped out argparse bits and now you just set the variables inside the script itself.

So fire up your editor of choice and edit:

username = ""
password = ""
client_id = ""
client_secret = ""

Username and password are… your Reddit username and password. The client_id and client_secret you get by creating an app in Reddit. Go to, login, and (at least using go to preferences –> apps –> create app. Click “script”, name it whatever you want and give it any description you want. For both about and redirect I usually use https://localhost.localdomain. Click create app and now you’ll see the client_id under the script name and you’ll see the client_secret labeled “secret”.

To run the script run % python

You’ll see your client_id, client_secret, and username echo as it deletes your saved posts and comments. You might have to run it a few times depending on how much you have saved, or you can run something like % watch -n 10 python

Have fun feeling unburdened by posts you’ll never revisit or read again!

Rob Musial

A kernel abstracting a kernel disguised as another kernel.