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 #

  1. Go to Facebook’s Ad Settings page.
  2. Click “Categories used to reach you”.
  3. Select “Interest Categories”.
  4. Start clicking “Remove” on every single item.

The Quick Way #

Here’s how to disable all those targeted ad categories at once:

  1. Open your browser’s Developer Tools:
    • Firefox: Hit F12
    • Chrome: Press Ctrl + Shift + J (Windows/Linux) or Cmd + Option + J (Mac)
  2. Click on the “Console” tab.
  3. Copy this one-liner:
var nextTime = 0; for (const remove of $x("//*[text() = 'Remove']")) setTimeout(function(element) { element.click() }, nextTime += 500, remove)
  1. Paste it into the console and hit Enter.
  2. Watch as all the “Remove” buttons are clicked automatically!

What’s Happening #

This script does three things:

  1. Finds all the “Remove” buttons on the page.
  2. Schedules a click for each button.
  3. 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!