Disabling Facebook Connect on Non-Facebook Websites

** Updated 7/19 - improved code after re-reading the ABPlus guide thanks to a user comment from Mr. Palant - also added Chrome code from reader tips**

For reasons I won't get into in this post I'm very discouraged by the recent Facebook Connect changes that have, without my approval, spread my Facebook persona across various websites that personally I don't want integrated with Facebook. Some examples are the Gawker Media Sites, techcrunch or money.cnn.com - I've recently started seeing little things like this all over sites: Facebook Connect: As seen from money.cnn.comFacebook Connect: As seen from money.cnn.com
Here is how to disable Facebook Connect completely

Because of a lack of opt-out available, I've been forced to use an Ad Blocker to disable this functionality completely. I've tested this for a while and after a number of tweaks I finally found a solution that does not break any on Facebook functionality while stopping Facebook Connect.
1. Get Firefox (if you still use IE sorry, can't help you there).
2. Install AdBlock Plus for Firefox - here. Click the Install Adblock Plus 1.2 link (1.2 may change). This will present you with a Yellow Security bar near the URL bar at the top of your screen: click Allowclick Allow You will then be prompted to install the add-on after a short countdown click Install Nowclick Install Now After Install you will be asked to restart Firefox for the install to complete click Restart Firefoxclick Restart Firefox Once Complete and Firefox restarts you will have a new ABP icon in next to the search box as well as a new AdBlock menu item under Tools > AdBlock Plus Preferences - access the preferences via the button or menu item
3. Add the following "Facebook Block" Filter Click the Add filter... button - in the text field that appears copy and paste the following line:

||facebook.*$domain=~facebook.com|~127.0.0.1

I've received some emails asking for an explanation of the block code - so here it is ||facebook.* is to block anything from Facebook's domains. $domain=~facebook.com|~127.0.0.1 is an exclusion to the block that states if you are actually on facebook.com don't block the content. The 127.0.0.1 exclusion is your local computer - this is because the Facebook plugin used by the Java picture uploader actually loads from your local computer, this makes sure the uploader continues to work.
4. Click Apply - OK
That's it - you now have blocked Facebook Connect (no more like or share buttons and no more auto-logged into website X using your Facebook cached credentials) - you can test it by visiting any article on money.cnn.com (not the main page but an article) and you should see zero Facebook integration. If you come across any pages that this didn't work - let me me know in a comment below so I can "expand" the guide to make sure that site is blocked too.

Chrome Instructions

Per user tips (not tested myself) the same can be done for Chrome Browsers using the Ad Block Plus plugin for that browser with only a small change to the code:

*.facebook.*$domain=~facebook.com|~127.0.0.1

(missing the pipe charaters ||)

 

Comments

Yeah, I tried this and all it did was keep my FB photo from showing up when I comment on a WP post.
Thank you for the code blocking facebook, but after further testing, it only hides it. Facebook still connects to those sites that utilize facebook connect and they can still log my facebook id.
Thanks so much for this!
I used your chrome addition, thanks so much!
Thank you!
On teefury.com, the block removed the "like" facebook button, but the "connect" one is still there. It's deactivated, but I still have to look at it. I hate facebook.
Teefury is a perfect case on why image blocks won't work, a quick parse of their page shows they have created/hosted the Facebook button's locally instead of from Facebook's servers - in cases like this the buttons for like/connect/etc all come from Teefury not Facebook, sadly many sites do this so the image blocks don't work. But the good news is while the image shows up it doesn't do anything with the block in place because the connect scripts still come from Facebook directly
Your filter should go like that:
Quote:
||facebook.*$domain=~facebook.com|~127.0.0.1
|| already makes sure that eventual subdomains are accepted, by putting "*." after it you make the filter too generic (it will block if it sees ".facebook." anywhere in the address). Also, if you end your filter with * it is pointless to also add a separator placeholder after that - there will always be a separator somewhere in the address.
Wladimir Palant
Thanks for the tip, I went back to the ABP guides and agree, it seems some of the code was redundant....
Wladimir's the current guy maintaining AdBlock Plus, so, yup, he'd be right. ;-)
Is it really that hard to just logout of facebook? Those annoying facebook post boxes everywhere just serve as a reminder that you should logout of facebook, which is good practice anyway.
While I agree with you in principle, sadly in practice I think many of us (me included) are so used to staying logged into the pages we visit daily (or in the case of Facebook - hourly). I too forget to "Sign Out" all the time, and without the block I was actually finding out that I was being logged in automatically to sites (Gawker media sites for example) with my Facebook account before I could even login with my Gawker credentials. Forcing me to log out there, then login again with the right account.
Any advice for Safari users? Thanks!
Sadly I do not use Safari - I will have to defer to readers to help out here (like the Chrome users did below).
Hi just wanted to share that if you install Adblock plus for Chrome, got to blacklist and add the line mentioned in the post but dont use the || Using pipes will render the filter invalid. Cheers and many thanks for this :)
Thanks for the update, I don't use Chrome, but it sounds like it works from other comments. Appreciate your contribution.
Another thanks to you--this works well.
Thanks for that, works nicely for Chrome with that adjustment.