If you're like me, you've amassed hundreds, if not thousands, of "interests" on Facebook over the past decade. These interests can be used to track, target, and advertise to you. These public "likes" can also be used for more nefarious purposes, like blackmail or coersion (https://www.forbes.com/sites/kashmirhill/2013/01/23/facebook-graph-search-embarrassing).
This is a short guide on how to easily remove them.
-
First, make sure you're logged into Facebook and navigate to https://www.facebook.com/adpreferences/?section=interests
-
Click "See All Interests"
-
Open your browser's Javascript console and type in:
setInterval(function(){ document.querySelectorAll('div[aria-label="Remove"]')[0].click() }, 2000);
where2000
is the number of miliseconds to wait between clicking the "Remove" button. My default is a sensible two seconds. This function clicks "Remove" over and over again. Facebook makes it purposefully cumbersome to remove all interests at once. -
Wait.
Great work!
It's difficult to pin down a suitable interval, but 2000ms takes a very long time for anyone who's been on the site for more than a few months. Realistically, you could probably get away with 250-500ms.
I adapted your version:
This doesn't wait for the previous item to be clicked (i.e. for matching element at index 0), and instead cycles through each matching DOM node, and using a timeout that's offset by the index of the node * a suitable interval.
I found that with this version and 250ms, although I had to refresh the page 2-3 times and run the script each time, it managed to get through the entire process in about 3-4 minutes. With the original version posted, it would have taken over 40 minutes to clear out the list. The trade-off is either fire-and-forget (original version) or speed with some intervention required (my version).