How to Turn off Political Ads on Facebook (and All Targeted Ads)

In my opinion, targeted ads is the worst thing that happened to the Internet. Big tech companies need to understand that they must stop this creepy behavior of following us everywhere.

But targeted ads is something that already happened and we can’t roll it back. However, most websites offer some way in their settings to disable ads customization.

For Facebook, we can do that in the Ad Settings page.

First click Categories used to reach you then click Interest Categories.

You should now have a long list of categories that you’re interested in.

No doubt that Facebook knows more about you than you know about yourself.

And your mission now is to click every Remove button on the list. This seems like an exhausting task, right?

Luckily, your browser offers you a quick way to do so.

Press F12 to toggle your Developer Tools in Firefox (called DevTools in Chrome), then select the Console tab.

Now you’re all ready to copy/paste the following JavaScript one-liner in your Console. This will click all the Remove buttons for you.

var nextTime = 0; for (const remove of $x("//*[text() = 'Remove']")) setTimeout(function(element) { element.click() }, nextTime += 500, remove)

In a nutshell, this code selects all elements in your page that have “Remove” text using an XPath locator. Then it loops over the elements and schedules a click() event every 500 milliseconds. The delay simulates a real person clicking the buttons sequentially.

Now you’re ready to browse Facebook without the annoying targeted ads.

If you like my tip, please share it on… Facebook.

Thank you for reading me.

all tags