Vertical Forest

Blocking Facebook Ads

Friday, February 22nd, 2008

**I apologize on my silence for a long time, but I am no longer maintaining this script. Facebook has made changes to their page layouts to make it virtually impossible to block ads using only CSS, so the method employed here no longer works. I would recommend using a general ad blocking extension instead.**

**Updated:** Now blocks the social ads which show up in the news feed as well.

**Updated x2:** Updated for the new Facebook, and now blocks the sponsor ads on the homepage as well.

**Updated x3:** Blocks new sponsor ads in the sidebar.

I just received a request from a friend on Facebook to join a group petitioning that the stupid x-rated ads it shows be removed. Nice as it would be if Facebook would do this, realistically, I highly doubt they ever will. Fortunately, that doesn’t mean you still have to look at them.

A few months ago I became so fed up with these ads, that I wrote some CSS rules that will work in any browser to block these ads. If you don’t know what CSS is, don’t worry, it doesn’t matter, just follow the steps below and the Facebook ads will be banished forever.

Note: These steps are only necessary if you are using a browser other than Firefox. If you are using Firefox, simply install [Adblock Plus]( and you’re done. For those using Internet Explorer or Safari, read on.

1. Open a new text file in Notepad, Texmate, or a similar program and past the following line into it:

`#ssponsor, .footer_ad, .banner_ad, .social_ad, .ad_capsule, .sidebar_ads, .adcolumn, .admarket_ad, .sidebar_item.sponsor, .emu_sponsor, .home_sponsor, .UIHomeBox_Sponsored { display: none !important; }`

2. Save the file to your user directory or My Documents folder, and call it ‘usercontent.css’.

**Note:** If you are using TextEdit on a Mac, you will need to go to the Format menu and click “Make Plain Text” before you save the file. Otherwise, you will not be able to save it as a .css file.

3. Depending on what browser you are using, this step will vary.

**For Internet Explorer users:**
Go to Tools->Internet Options, the click on Accessibility down at the bottom right. Then under User Stylesheet check the box ‘Format documents using my stylesheet’, and then click browse. Locate and select the ‘usercontent.css’ file you saved earlier. Hit Open, then Ok, and Ok again, and you’re done. Once you reload Facebook, the ads should be gone.


**For Safari users:**
Go to Safari->Preferences->Advanced, and select ‘Other’ from the Stylesheet dropdown near the bottom. Browse to where you saved the ‘usercontent.css’ file, select it, click Choose, and you’re done. Once you reload Facebook, the ads should be gone.


Enjoy an ad-less Facebook!