Ash Clarke

Software Engineer. User Interface Developer. Gamer. Nerd.

How to Hide Facebook Ads in Mozilla Firefox with Stylish

| 44 Comments

Ads. They suck. You never click them and they don’t benefit your life whatsoever.

If this sounds like you, I will now let you in to a secret way of hiding them that no company ever wants you to find out…

Not really, it’s just CSS styles. First step is to download the Stylish add-on for Mozilla Firefox.

After you have installed the add-on and restarted Firefox, visit Facebook.com.

In the bottom right corner of Firefox, there will be an S icon.

Clicking this will open up a menu, where you can choose to “Write a New Style”. Click the “For facebook.com” option.

This will bring up a new window where you can enter your new styles to override the Facebook developers’ defaults. I have added a screenshot to show where the new styles go.

Now you can replace the text in the window with the following rules:

@-moz-document domain("facebook.com") {
/* Updated 16-09-2012 */
/* Hide ads on Home */
#rightCol #pagelet_ego_pane_w,
#pagelet_ads_when_no_friend_list_suggestion { display: none; }
/* Hide Right Column Footer on Home */
#rightCol #pagelet_rhc_footer { display: none; }
/* Hide ads on Timeline and Photo View */
.fbTimelineSideAds,
#rightCol #pagelet_side_ads,
#fbPhotoSnowliftAdsSide,
div[class*=snowliftAds],
.ego_section[data-adblock-hash],
._24q .ego_column:not(.egoOrganicColumn) { display: none; } /* Hide ads on Friend's Profiles */ #rightCol #pagelet_ego_pane .ego_column:not(.egoOrganicColumn), [data-referrer*=pagelet_side_ads] { display: none; } /* Hide ads on Comment View */ .UIStandardFrame_SidebarAds #pagelet_ego_pane .ego_column:not(.egoOrganicColumn) { display: none; } /* Hide "People you may know" on Comment View */ .UIStandardFrame_SidebarAds #pagelet_ego_pane .egoOrganicColumn { display: none; } /* Hide ads and sponsored stories on Message View */ #MessagingNetegoSidebar #pagelet_ego_pane .ego_column:not(.egoOrganicColumn), #MessagingNetegoSidebar .ego_column:not(.egoOrganicColumn) { display: none; } /* Hide ads on Lists */ #pagelet_ads_when_no_friend_list_suggestions .ego_column:not(.egoOrganicColumn) { display: none; } }

Click the “Preview” button and you should see the ads disappear in the background. Click “Save” and the window will close. The styles will now be loaded when you visit any part of Facebook.

Let me know if this doesn’t work, or stops working. The styles above are heavily dependent on how Facebook developers have named the Ad elements on the site.

If they, therefore, realise another lovely update the ads might suddenly reappear and I will have to spend another 30 seconds writing a new style and 10 seconds updating this post : )

If you feel you can’t trust this, or it looks like something messed up, you can find the “Uninstall” (to remove it) or “Disable” option by right-clicking on the style when visiting Facebook.

UPDATE [06/09/12]: Updated to hide another case of ads on photo viewer.

UPDATE [06/09/12]: Updated to hide more ads on news feed page and friends’ timelines.

UPDATE [26/08/12]: Updated to hide more ads on photo view page.

UPDATE [30/07/12]: Updated to hide ads on message view page.

UPDATE [30/06/12]: Updated to hide ads on lists.

UPDATE [03/06/12]: Updated to hide ads on friend’s profiles.

UPDATE: Added styles to hide new ads on the new timeline profile.

UPDATE [02/11/11]: Updated with new css to reflect recent code changes by FB devs.  Thanks, “R Preston Berrett”.

UPDATE [02/12/11]: Updated with new css to reflect changes to the FB site. Added better comments to explain what each bit is doing.

UPDATE [02/12/11]: Updated with new css to hide ads on “pages”. Thanks “J Greener”.

Author: Ash Clarke

I am a user interface developer based in central Reading.

44 Comments

  1. I've been using this for over a month now, and it has been working perfectly until today, when I noticed that the ads are back. I spent about 15 minutes trying to figure out how to do it myself, but figuring out the syntax is a little difficult than I thought it would. Would you mind updating the post? Thanks!

    • I've put in a quick edit – hopefully that will do the trick! Let me know.

      • Yes, that did the trick.
        So, I'm a Computer Science major in school right now. And last night I took a swing at modifying the script, and got as far as removing the ads from my home page. But, this morning I noticed that my edit did not remove the ads when I visited a friends page. Again, thanks for this.

  2. Pingback: How to Hide Facebook Ads in Google Chrome with Stylish | Ash Clarke

  3. Ashley. You are my hero. You make bad ads go away. Ads can get very irritating when I'm on the Facebook looking for hot penguin ladies. Facebook ads make me even more evil than I am most of the time. Seriously – I do awful things.

    All the best, and keep up the good work, Mr C. If the ads re-appear, I'ma comin' for you….

  4. The ads are back. You're dead.

    • You'll have to say which page and what section because each part is different :)

      Then I can add the code in with the rest.

      Thanks!

  5. Hi Ash, will these fixes (and thank you!!) hide ads when others view our business page?

    • Hi "J",

      Just checked and it wasn't so I have just updated with another line to hide ads on pages.

      Hope this helps!

  6. Hi “J”,
    I’m pretty sure they will as Facebook pages typically follow the same layout.
    I will check during the weekend and make sure.
    Thanks!

  7. you love this? [URL=http://www.louis-vuitton–outlet.net/ – louis vuitton outlet[/URL – and check coupon code available qHddVwru [URL=http://www.louis-vuitton–outlet.net/ – http://www.louis-vuitton–outlet.net/ [/URL -

  8. buy coach online stores pyYYrFgH [URL=http://www.cheap-coach–handbags.net/ – knock off coach bags[/URL – to get new coupon fcgEUgMa [URL=http://www.cheap-coach–handbags.net/ – http://www.cheap-coach–handbags.net/ [/URL -

  9. buy cheap uggs online YEKdVfpa [URL=http://www.uggs-outlet–online.org/ – discount uggs[/URL – , just clicks away pYufpSXa [URL=http://www.uggs-outlet–online.org/ – http://www.uggs-outlet–online.org/ [/URL -

  10. check this link, cheap prada handbags mFIoeTty [URL=http://www.cheap-prada-bags.net/ – prada outlet online[/URL – suprisely QBtMNMte [URL=http://www.cheap-prada-bags.net/ – http://www.cheap-prada-bags.net/ [/URL -

  11. check aaa replica zokSmblI [URL=http://www.aaa-replica–handbags.org/ – high quality replica handbags[/URL – to take huge discount SNvYkQGS [URL=http://www.aaa-replica–handbags.org/ – http://www.aaa-replica–handbags.org/ [/URL -

  12. you love this? replica handbags wholesale SEgQvbQK [URL=http://www.replica-handbags–wholesale.com/ – wholesale replica handbags[/URL – for less cCAomflF [URL=http://www.replica-handbags–wholesale.com/ – http://www.replica-handbags–wholesale.com/ [/URL -

  13. you must read [URL=http://www.louis-vuitton–outlet.net/ – loui vuitton outlet[/URL – to your friends czjyoxaf [URL=http://www.louis-vuitton–outlet.net/ – http://www.louis-vuitton–outlet.net/ [/URL -

  14. you love this? aaa replica handbags anfuZGjp [URL=http://www.aaa-replica-handbags.net/ – top replica handbags[/URL – for promotion code xPWZbXvI [URL=http://www.aaa-replica-handbags.net/ – http://www.aaa-replica-handbags.net/ [/URL -

  15. buy best fake chanel handbags NxKnoxgd [URL=http://www.fake-chanel–bags.org/ – chanel handbags shop online[/URL – suprisely THuDbELw [URL=http://www.fake-chanel–bags.org/ – http://www.fake-chanel–bags.org/ [/URL -

  16. get cheap cheap prada handbags RPxVqHxt [URL=http://www.cheap-prada-bags.net/ – cheap prada handbags[/URL – , just clicks away YptMnkSd [URL=http://www.cheap-prada-bags.net/ – http://www.cheap-prada-bags.net/ [/URL -

  17. I am sure you will love replicas aaa NydOskcO [URL=http://www.aaa-replica–handbags.org/ – faux louis vuitton[/URL – for gift LzStPfjV [URL=http://www.aaa-replica–handbags.org/ – http://www.aaa-replica–handbags.org/ [/URL -

  18. buy a replica handbags wholesale GubYztCC [URL=http://www.replica-handbags–wholesale.com/ – wholesale replica handbags[/URL – to get new coupon fbBjfOcC [URL=http://www.replica-handbags–wholesale.com/ – http://www.replica-handbags–wholesale.com/ [/URL -

  19. I am sure you will love aaa replica handbags QFBFvScj [URL=http://www.aaa-replica-handbags.net/ – aaa replica handbags[/URL – with confident jxILMXlA [URL=http://www.aaa-replica-handbags.net/ – http://www.aaa-replica-handbags.net/ [/URL -

  20. click to view [URL=http://www.karen-millen-uk.net/ – karen millen outlet online[/URL – and check coupon code available xwYSqmyc [URL=http://www.karen-millen-uk.net/ – http://www.karen-millen-uk.net/ [/URL -

  21. check chanel handbags outlet ulAQtlbV [URL=http://www.fake-chanel–bags.org/ – chanel discount[/URL – at my estore FxEJSYtR [URL=http://www.fake-chanel–bags.org/ – http://www.fake-chanel–bags.org/ [/URL -

  22. get [URL=http://www.louis-vuitton–outlet.net/ – louis vuitton outlet[/URL – for gift JrbebGtb [URL=http://www.louis-vuitton–outlet.net/ – http://www.louis-vuitton–outlet.net/ [/URL -

  23. sell aaa replica bags aDtMUxbm [URL=http://www.aaa-replica–handbags.org/ – aaa handbags[/URL – , just clicks away ntJLefBS [URL=http://www.aaa-replica–handbags.org/ – http://www.aaa-replica–handbags.org/ [/URL -

  24. buy best coach purses outlet online zYJQnsAy [URL=http://www.cheap-coach–handbags.net/ – coach handbags cheap[/URL – and get big save DRabCaVj [URL=http://www.cheap-coach–handbags.net/ – http://www.cheap-coach–handbags.net/ [/URL -

  25. for cheap prada bags kEuELIuz [URL=http://www.cheap-prada-bags.net/ – cheap prada bags[/URL – at my estore fIeOzpKX [URL=http://www.cheap-prada-bags.net/ – http://www.cheap-prada-bags.net/ [/URL -

  26. you must read aaa replica bags YVtvVXUw [URL=http://www.aaa-replica–handbags.org/ – high quality replica handbags[/URL – suprisely SsyxcnZj [URL=http://www.aaa-replica–handbags.org/ – http://www.aaa-replica–handbags.org/ [/URL -

  27. order an [URL=http://www.ralph–lauren-outlet.com/ – ralph lauren online outlet[/URL – for less NjnQwqQo [URL=http://www.ralph–lauren-outlet.com/ – http://www.ralph–lauren-outlet.com/ [/URL -

  28. That the difference between that the right word and the just about right word is
    more than just a fine line! it’s like the difference between a lightning bug and the
    lightning!

  29. purchase [URL=http://www.louis-vuitton-uk.info/ – louis vuitton shop online uk[/URL – , just clicks away qgfOfEtl [URL – http://www.louis-vuitton-uk.info//URL -

  30. vista [URL=http://2-store.net/ – louis vuitton replicas[/URL – tomar gran descuento KduIIBvl [URL=http://2-store.net/ – http://2-store.net/ [/URL -

  31. to buy [URL=http://www.burberry–outlet–online.net/ – burberry raincoat[/URL – online UeteJGhY [URL=http://www.burberry–outlet–online.net/ – http://www.burberry–outlet–online.net/ [/URL -

  32. view [URL=http://encyklopediaverbena.pl/index.php?title=User:burberryoutlet564 – encyklopediaverbena.pl/index.php?title=User:burberryoutlet564[/URL – at my estore fBaDplTG [URL=http://customersupportimages.iplay.com/index.php?title=User:burberryoutlet564 – http://ii-ego.org/index.php?title=User:burberryoutlet564 [/URL -

  33. sell [URL=http://www.ralph–lauren–outlet.net/ – ralph lauren outlet[/URL – to your friends LserFdUk [URL=http://www.ralph–lauren–outlet.net/ – http://www.ralph–lauren–outlet.net/ [/URL -

  34. must look at this [URL=http://www.moncler–outlet.com/ – moncler[/URL – and check coupon code available tUblTXBk [URL=http://www.moncler–outlet.com/ – http://www.moncler–outlet.com/ [/URL -

  35. I am sure you will love gucci handbag outlet rThxJAmm [URL=http://www.gucci–outlet–online.net/ – gucci online shop[/URL – to your friends oEjNvlVg [URL=http://www.gucci–outlet–online.net/ – http://www.gucci–outlet–online.net/ [/URL -

  36. check burberry t shirt qZOYBByg [URL=http://www.burberry–outletonline.com/ – burberry usa[/URL – for gift EHnxdhqK [URL=http://www.burberry–outletonline.com/ – http://www.burberry–outletonline.com/ [/URL -

  37. you must read [URL=http://www.guccioutlet–online.org/ – gucci shop online[/URL – to get new coupon mSSNBSUo [URL=http://www.guccioutlet–online.org/ – http://www.guccioutlet–online.org/ [/URL -

  38. para un [URL=http://2-store.net/ – neverfull louis vuitton[/URL – para el c¨®digo de promoci¨®n ppYRlmHw [URL=http://2-store.net/ – http://2-store.net/ [/URL -

Leave a Reply

Required fields are marked *.