Turn Off All Facebook Targeted Ads with One Click
This post is from 2021 and hasn’t been updated since. I’ve completely stopped using Facebook years ago. Maybe you should too? Your mental health might thank you!
Tired of Facebook’s targeted ads? Me too. These ads can be intrusive and raise privacy concerns, as they’re based on your online behavior and personal information. While you can turn them off manually, it’s a pain to click through dozens (or hundreds) of categories. Let’s fix that with a bit of JavaScript.
Keep in mind that this method disables targeted ads, but it doesn’t remove ads entirely from Facebook. You’ll still see ads, but they won’t be personalized based on your interests and behavior.
The Manual Way #
- Go to Facebook’s Ad Settings page.
- Click “Categories used to reach you”.
- Select “Interest Categories”.
- Start clicking “Remove” on every single item.
The Quick Way #
Here’s how to disable all those targeted ad categories at once:
- Open your browser’s Developer Tools:
- Firefox: Hit
F12
- Chrome: Press
Ctrl + Shift + J
(Windows/Linux) orCmd + Option + J
(Mac)
- Firefox: Hit
- Click on the “Console” tab.
- Copy this one-liner:
var nextTime = 0; for (const remove of $x("//*[text() = 'Remove']")) setTimeout(function(element) { element.click() }, nextTime += 500, remove)
- Paste it into the console and hit Enter.
- Watch as all the “Remove” buttons are clicked automatically!
What’s Happening #
This script does three things:
- Finds all the “Remove” buttons on the page.
- Schedules a click for each button.
- Adds a tiny delay between clicks to avoid tripping Facebook’s bot detection.
And just like that, you’ve saved yourself from repetitive clicks and improved your privacy.
Notes #
- Facebook might change things up, so if this stops working, the XPath selector might need tweaking.
- You may need to repeat this process periodically, as Facebook could add new categories over time.
- This method worked at the time of writing, but Facebook may have changed their interface since then.
- Use responsibly and at your own risk. I’m not responsible if Facebook gets upset about it.
- If you found this helpful, consider sharing it with friends who might be interested.
For additional privacy on Facebook, consider reviewing your privacy settings regularly and being mindful of the information you share on the platform.
When I used this method, I noticed a significant decrease in strangely specific ads. It was refreshing to see more generic content instead of ads that seemed to read my mind!