
DeleteFB: Selenium script to delete all of your Facebook wall posts - anaphor
https://github.com/weskerfoot/DeleteFB
======
AdmiralAsshat
I don't trust the "delete" button to scrub it from FB's database.

I'd be slightly more confident ( _slightly_ ) that editing the post might
cause the core data in the db to be updated, however. In which case, I think
the more effective script would be one that goes through all of your FB posts
and scrambles them, or replaces the text with gibberish.

~~~
saddlerustle
Lots of people in this thread are claiming that it doesn't based on gut
feeling, but consider:

\- Facebook publicly claims it does [1]

\- Mark Zuckerberg testified in-front of congress and stated they do [2]

\- Multiple government regulators have specifically checked that it does in
their privacy audits. [3]

They might be lying and actively conspiring to not delete it, but they'd have
to have a _very_ good reason to take on that much legal risk.

Now, consider:

\- A infinitesimal fraction of facebook users try to delete anything.

\- Facebook makes money from your data by showing you ads. If you stop using
facebook, you stop generating any revenue and your data becomes a liability,
not an asset.

What reason would there be to lie about it?

[1]
[https://facebook.com/help/250563911970368](https://facebook.com/help/250563911970368)

[2] [https://www.washingtonpost.com/news/the-
switch/wp/2018/04/10...](https://www.washingtonpost.com/news/the-
switch/wp/2018/04/10/transcript-of-mark-zuckerbergs-senate-hearing)

[3]
[https://www.pdpjournals.com/docs/87980.pdf](https://www.pdpjournals.com/docs/87980.pdf)

~~~
z3c0
Was the nature of deletion explicitly defined as "deleted records are removed
from all databases, data warehouses included"?

They technically wouldn't be lying if they only deleted the record from
application systems, but retained it in historical data by simply setting a
bit flag (eg "IsDeleted") to 1.

The question about what motive they have comes down to whether or not the
types of posts a person deletes indicate something meaningful about their
personality. Ad analytics are ultimately seeking to understand the kind of
person you are, after all.

~~~
z3c0
I read the audit, and here's something I noticed (other than that it's 8 years
old):

"In determining appropriate retention periods for personal information, data
controllers can have due regard to any statutory obligations to retain data.
However, if the purpose for which the information was obtained has ceased and
the personal information is no longer required for that purpose, the data must
be deleted or disposed of in a secure manner. Full and irrevocable
anonymisation would achieve the same objective." (Page 69, under 3.4
Retention)

So basically, as long as it's anonymised, the data can be retained.

~~~
IggleSniggle
But “if the purpose for which the information was obtained” was to enable
better ad targeting, then “data retention” is still “appropriate”, eh?

Under this reading, is there even an obligation to anonymize? And how
anonymous does anonymous need to be? Does a simple base64 encoding count as
“anonymized”?

~~~
z3c0
I had that thought originally too - however the keywords here are "statutory
obligation" (basically, legal reasons.) So if the FBI asked them to retain the
data, they can do so as long as the FBI needs it.

And the matter of anonymisation is a great question - "irrevocable"
anonymisation certainly has a different meaning back in 2011, when swapping a
name for a guid would do the job. Nowadays, it would require at least deleting
all relationships as well, since social network analysis is much more advanced
these days (especially at FB, of all places.) It wouldn't be impossible to
derive the identity of an anonymous account/record based on the undeleted data
associated with it. And since FB's "ghost profiles" are something we know
exist, I think it's safe to assume those relationships are being maintained
somehow.

------
new_here
About a two years ago my friends and I used to scroll back into each other’s
posts from the early days and ‘like’ some of the most cringeworthy posts and
photos we could find. It would cause them to bubble up into everyone’s
newsfeeds again. Was a fun game.

This script would have saved me some manual labour back then.

(Edit: we also used to endorse each other on LinkedIn for the most bizarre
skills we could find. Toilets, divorce and animal husbandry to recall a few)

~~~
jxcl
A fun artifact of deleting your facebook account is that all of your comments
get deleted (hidden, I guess, is more accurate) too, which means that in old
threads people who interacted with you now appear to be interacting with
themselves.

My friend had a profile picture in which he was doing something silly with his
eyebrows. I commented "Nice eyebrows" and he replied "You're just jealous."
I've since deleted my account and now there is only one comment on this
profile picture, by the person the picture is of, reading "You're just
jealous."

------
SteveNuts
What do you think the chances are that Facebook actually does any delete
operation on their data? I'm sure this is simply marking it as hidden in their
database. Maybe I'm just paranoid, but to me the only way to take back
something you say on social media, is to never have posted it in the first
place.

~~~
mdjasper
There are a million reasons to agree that the data is never actually deleted

* need to retain data to fulfill government requests

* internal auditing

* it's all backed up in some "data lake" somewhere to do internal ml or analytics on

* hundreds of copies in database backups from different times

* internal logs that contain the data

* it's already been analyzed and aggregated into learning products and models that aren't going to be recomputed

It's not being "paranoid". As someone who has worked on large scale saas, I
say: there is zero, 0, ZERO, 0.00 chance of that data every actually being
deleted

~~~
ForHackernews
Ever is a very very long time indeed. Facebook will go out of business or get
sold eventually and delete it all to save money or by accident.

See also: Myspace accidentally dumping everything pre-2015
[https://www.engadget.com/2019/03/18/myspace-lost-12-years-
mu...](https://www.engadget.com/2019/03/18/myspace-lost-12-years-music-
photos/)

~~~
monocasa
For similar reasons, I doubt very much that they actually deleted everything
they said they did. I know that they were backing up to tape and storing it at
Iron Mountain years prior.

~~~
dx034
But someone has to pay that bill. If Facebook ever fails, I doubt that someone
would keep data centers full of information around without getting paid.

~~~
monocasa
They would sell it with their other assets.

------
spieglt
I wrote a similar tool in Node a while back that can delete by year and
category:

[https://github.com/spieglt/fb-delete](https://github.com/spieglt/fb-delete)

And one to download all "Photos of you", which Facebook doesn't include when
downloading your data:

[https://github.com/spieglt/fb-photos](https://github.com/spieglt/fb-photos)

~~~
Jaruzel
Seeing as we're sharing, here's my (previously posted to HN) effort:

[https://github.com/Jaruzel/DeleteFacebookActivity](https://github.com/Jaruzel/DeleteFacebookActivity)

It works very well, but needs Windows.

~~~
spieglt
Heh, your blog post about that was the inspiration for mine, thanks.

------
nostalgk
Does anyone know if there is an equivalent to delete Facebook friends or
unlike pages/leave groups? I really want to clean out my Facebook since I've
had it for a very long time and much of it doesn't appeal to me anymore, but I
don't necessarily want to lose the tiny social ecosystem I've created with my
family.

However, I would like to remove the hundreds of friends and pages that I don't
talk to/don't represent me/are mining my data even more than the platform is.

~~~
sdrinf
I did this a year ago, and it considerably improved my Fb feed’s signal/noise
ratio.

Specific procedure I’d recommend is to make this a regular process: open fb
feed, read until you find a thing which does not improves your life, click on
owner (author / group) -click “friend” -> unfollow. Iterate until sanity is
restored.

And one moral of this story (hi Facebook, please understand this) is that
people are multidimensional. Just because you know someone once, in one
context in real life, does not, actually, imply positive relationship on
informational ecologies for all time in the future. “Authentic self” as
defined by Facebook as a single coherent identity is a lie.

~~~
donatj
Maybe I'm too forgiving but I'll generally just snooze a person unless they're
genuinely consistently horrible.

People change. I had friends who would post tireless political rants that just
post memes now.

~~~
nostalgk
My experience is that I have hundreds of people to snooze, and would rather
just have a fresh start and let those people trickle back in if they want to.
Maybe I should just make a new account.

~~~
amerkhalid
I did that last year, created a new account. Added back only a few real
friends.

But slowly started getting requests from many of the previous friends. Some
thought I had unfriended them, so had to explain to them that it was a new
account. Felt obligated to add back most of the people. Now my feed is useless
again.

Perhaps this should be yearly ritual.

~~~
helloindia
Things to remember when you create a new account: 1\. an alias for profile
name rather than real name 2\. don't put your picture in your profile

This way, you can add people you want to, and you'll not get requests from
people you're hiding from.

------
Vordimous
So I have been putting together a way for people to more easily make their own
blogging platform. It would kind of mimic a social media platform, but since
everything is committed to a repository using the JAMstack it could easily be
converted to a full website or in your case you could simply delete the
repository or any number of your posts because they are just files in your
repository. Any feedback would be wonderful. [https://your-
media.netlify.com/post/make-your-own-media/](https://your-
media.netlify.com/post/make-your-own-media/) Everything is owned by the end
user. This is only providing a recipe for people to use. I will also mention
that [https://www.stackbit.com/](https://www.stackbit.com/) is doing basically
the same thing but more from a “Make life easier for Website designers”
perspective.

------
GaryNumanVevo
Here's a good app idea: Take all your facebook posts and replace them with
copywrited sections of books. I.g. my cringy posts from highschool become
chapters from Harry Potter.

No doubt Facebook would delete these posts permanently and DMCA them.

~~~
haser_au
This may work against you, especially if Bloomsbury Publishing issues an
infringement notice to Facebook. In that scenario, Facebook need to place your
account on 'legal hold', retaining the account and history indefinitely while
the copyright case is resolved. It's possible this would be cold-storage and
all past edits.

~~~
terminally_ill
Exactly the reason why I stopped using sources like Unsplash for free graphics
when I was as a young designer. Imagine the Enis' surprise when their shiny
new website came under attack by a zealous photographer for copyright
infringement. This woman is now a chief editor for a major publisher. This is
an awesome idea though, I think I'm going to go with Hunter S. Thompson
though. ]:\

~~~
VirenM
Could you give more context to this story, perhaps a link?

------
rashomon
You need to add a requirement that you had Chromedriver installed. I had
Chrome, homebrew and Python3 installed originally but without running:

brew cask install chromedriver

The script wouldn't work. Works great now!

~~~
anaphor
Thanks! I just added a note to the README mentioning it. I'm not sure how I
forgot it.

~~~
corbett3000
OP: I'm close to getting this to run but I get this error:

Traceback (most recent call last): File "./deletefb.py", line 3, in <module>
from seleniumrequests import Chrome ImportError: No module named
seleniumrequests

Any idea what's to be done?

~~~
anaphor
Sounds like you're trying to run it from source?

If so the steps would be:

1) virtualenv -p $(which python3) ./venv

2) source ./venv/bin/activate

3) pip install -r requirements.txt

Then you should be able to run it, assuming you have google chrome and the
chromedriver installed. It's called "chromium-chromedriver" on Ubuntu

------
e1ven
I've seen other people recommend the Social Book Post Manager extension [1] in
the past.

One of the nice things is you have more granularity in what you remove - You
can leave things that mention certain words, or in a date range, etc.

Because it runs in your browser, it should work with MFA logins, etc, without
submitting credentials to an external service.

[1] - [https://chrome.google.com/webstore/detail/social-book-
post-m...](https://chrome.google.com/webstore/detail/social-book-post-
manager/ljfidlkcmdmmibngdfikhffffdmphjae?hl=en-US)

------
temp99990
Is there a “Marie Kondo” for the digital world? Seems like something or
someone that could be just as relevant if not more than organizing your
physical world.

~~~
eswat
The book Digital Minimalism by Cal Newport has a concept called _Digital
Declutter_ that’s a similar concept but towards distracting tech.

------
ivan_ah
This is beautiful: succinct and powerful.

Back in the day there was a similar js bookmarklet that could be used to
export all your friends' contacts (name + emails) so you can leave without
worrying that you'll be missing out on all your "connections." It would be
nice to extend this with a "backup my posts + contacts" info before deleting
everything.

~~~
llamataboot
I was just thinking the same thing.

Seems like it would be easy to pop the text (and even comments) into some sort
of structured dataset for archiving's sake.

------
billysielu
I've been through this before and some posts 'came back'. The only way to be
sure is to delete your account. If you really want an account just make a new
one.

~~~
DerfNet
This was my experience using a Greasemonkey script some time ago. Some posts
would "come back", and there were pockets years back it couldn't even find to
delete, but were still accessible on my profile. Wound up just deleting my
account and making a new one that I never, ever post on.

------
red_hare
Alternatively, my friend turned on the "on this day" feature that would send
her a notification every day of what she did on facebook for that day of the
year.

So every day she just took a minute to the cringiest of that 1/365th of her
content and in just one year she was free.

~~~
markholmes
So it takes an entire year to maybe disassociate yourself from Facebook?

~~~
RhodesianHunter
No, it takes a year to clean out the stuff you want cleaned out if you want to
remain on Facebook and not sit down to the task for hours.

------
siquick
Is there anything similar where i can see all of my posts on one page and just
check a series of checkboxes to delete the ones I want rid of?

------
leesec
Any chance a feature could be added to delete posts by year?

Would love to scrub like 5 years or so but keep some more relevant memories.

Thank you.

~~~
anaphor
Great idea. I had also thought of adding a feature to unfollow/unlike pages,
but haven't had much time yet to work on it.

------
2Ccltvcm
Some sure fire ways to get your account actually deleted, and quickly: post
large amounts of hardcore porn, extreme gore, and anything that puts Jews in a
negative light like Nazi symbols combined with the prior two methods. The
moderation team will nuke your accounts very efficiently.

~~~
chimpburger
Why was my reply flagged? This has actually happened for some FB users.

My flagged reply was: "Also, anything criticizing Islam or LGBTTQQIAAP rights"

------
kylehotchkiss
Love this script! I'm trying to use it to wipe 10 years of Facebook dumbness.
It can handle about a month's worth of posts before it crashes though. Is
there any try/catch/repeat loops you could add to resolve this?

    
    
        Message: no such element: Unable to locate element: {"method":"class name","selector":"layerConfirm"}
    

Or... is there a Python equivalent of "nodemon" I could run it behind?

Thanks for the great work! I was thinking Jumbo.app would implement something
similar by now but I realize the problem was hard to solve because facebook
doesn't let apps delete posts.

~~~
way66
we are working on facebook.... :)

CEO, Jumbo Privacy.

~~~
kylehotchkiss
Super excited to test it, didn't intend for facebook piece to be a criticism
of your app, which I highly enjoy and use regularly.

------
dontbenebby
At least FB lets you remove them from public view.

I recently tried to script clearing out my twitter linkes. (Some of which date
back to before <3s, when a star could mean "yikes, I don't want to RT this but
I want to note it". Others were just from when my twitter was more personal,
and now that I use it for professional purposes I don't need random likes from
the 2012 election lying around.

But Twitter now says I have about 4k likes, but only displays the ones since I
tried to run my script.

Occasionally, a weeks or months later older ones resurface, but if I try to
unlike them in bulk they disappear again to return at a random interval.

------
izzydata
I can't imagine this is more likely to actually delete the data on their end
than just deleting your whole account.

However, I am really interested in learning more about Selenium so I'm curious
to look at your project.

------
a-wu
Similar, but OT: does anyone know of a script that will delete your tweets
from before X date? There's tools that bulk delete, but I want to delete from
before a certain date.

~~~
kylehotchkiss
Jumbo App is easiest!

IIRC twitter's API doesn't allow you to bulk delete tweets from the outside.
I've found that exporting all tweets, getting the IDs, and then deleting them
in the browser using the twitter.com only browser API will allow you to delete
tens of thousands of tweets with no rate limits. I did something similar here:
[https://github.com/kylehotchkiss/fakeblock](https://github.com/kylehotchkiss/fakeblock)
but it's not documented well and Twitter's export file format actually tends
to change on a somewhat regular basis.

------
synaesthesisx
Is there a way to export the data beforehand? Just in case there are old
photos or anything one may potentially want to keep saved...

~~~
digianarchist
[https://www.facebook.com/help/1701730696756992?helpref=hc_gl...](https://www.facebook.com/help/1701730696756992?helpref=hc_global_nav)

See "How do I download a copy of my information on Facebook?"

------
srpguy
Kudos - this is very much useful. Anybody know of a script that will wipe
__all __content from facebook?

------
sidcool
Sweet and Simple. I have the habit of writing complex scripts leaning of super
clean code that deviates from the actual purpose. This is so clear. I could
understand the code in 5 min...That means it's super simple. And looking at
the votes it has received, it works!

Great work fellow programmer.

------
amelius
Facebook throttles me when I delete posts manually. So doing this
automatically will only make it worse.

~~~
kylehotchkiss
Hmm, I was catching this same issue while running this script today. Only in
the chrome instance that Selenium opened though. Facebook was working at
normal speed in my primary chrome instance.

------
scotchio
There needs to also be an obfuscate profile method.

Any data is probably never deleted. What makes more sense if a long running
script (multiple years??) that updates / inserts / deletes your profile with
random information.

------
dbg31415
Wait about a week, guessing this won't work if it builds up any significant
traction.

I want the ability to delete everything after some period of time. Every
message I send, every message I receive, I want it all to work like
conversation -- not contracts.

I don't want someone digging up an email from the past where I said something
stupid in a moment of anger, or frustration. If all tech worked like Snap
Chat, or Signal, I'd be really happy.

I have no trust that Facebook actually deletes anything. Guessing anyone who
tries to delete things actually flags the user and then their team of Zucks go
in and look at the juicy content you were trying to delete... seems like 5
years from now, Facebook will charge for the "not have anything dumb you said
in your 20s show up in public search" feature. Cool. Cool, cool, cool.

~~~
2Ccltvcm
Oversec might be able to help you

[https://www.oversec.io](https://www.oversec.io)

------
tuxpenguine
In most of the tech companies, deleting only means flipping a flag in the
column of the row so that those things won't show up to the user. "Hard
delete" is what you want.

~~~
anticensor
[https://news.ycombinator.com/item?id=19965287](https://news.ycombinator.com/item?id=19965287)
seems to disagree.

------
ndesaulniers
Whenever I try to delete old Facebook posts, I just get indefinite loading
bar. _Shrugs_ Seems like a well tested feature. /s (or maybe my posts are just
stored in ice).

~~~
robertAngst
One of your friends were probably hacked and data mined your facebook anyway.

------
edisonjoao
Delete Facebook and download the new way to connect
[http://foxie.cool](http://foxie.cool)

------
adzm
Regarding selenium, is there a better way to wait for a specific state or
element etc rather than simply sleep for a few seconds?

~~~
kyoob
It's considered a better practice to explicitly wait for an element on a page
before acting. How to do it is documented for the Python bindings here:
[https://selenium-python.readthedocs.io/waits.html](https://selenium-
python.readthedocs.io/waits.html)

------
nickpsecurity
This says wall posts. Im sure there's plenty of people that would like one for
comments, too. Anybody know scripts for that?

------
throwawaysea
What about something to scrub comments, or photos or likes (on others'
content)? Is there a similar script available?

------
Peyphour
Is there a guarantee that `pip install` download the exact same script as the
GitHub one ? If not it seems risky.

~~~
alexmorley
You can do pip install git+[https://github_repo_url](https://github_repo_url)
if you want

------
pxtail
I'm wondering - won't it trigger some antiscrape / antibot measures and lock
account?

------
nounounome
Facebook keeps all the posts or references to posts in a proprietary graph
database.

------
OBLIQUE_PILLAR
now how do i delete all of the comments ive left on facebook posts?

~~~
anticensor
Your comment is gone if post author removes his post.

------
dmead
well, shoulda posted this ages ago

[https://github.com/chriszimmerman/fbcleaner](https://github.com/chriszimmerman/fbcleaner)

~~~
idonotknowwhy
does this one still work?

~~~
dmead
I have no idea.

------
cfarm
To my knowledge, there is no way to actually do this correct?

------
billions
Would prefer migration to a decentralized alternative

------
holler
after a decade of use I just permanently deleted my account on a whim, then
was told it will be deleted in 30 days...

------
neiman
Fantastic! Now the same for Firefox please.

~~~
bluehatbrit
I'm a user and fan of FF, I left chrome a while back now, but for one piece of
one-off automation why couldn't you use Chrome?

~~~
neiman
My new year resolution for 2019 was to keep my computer Google free. It's less
of a statement and more a "fun" geeky game. So I rather not install Chrome:-)

------
idonotknowwhy
Got one for linkedin and discord?

------
EGreg
Facebook will just rate limit you

~~~
stendinator
I did have this happen to me when I tried to delete many of my posts at once.

------
m3kw9
How about name it rm -rf for fb

------
lawlessone
How long will this work for?

------
edisonjoao
love this

------
robertAngst
I want scrape, save, delete.

So I can have my old thoughts

