Ash Clarke

Software Engineer. User Interface Developer. Gamer. Nerd.

How to Hide Facebook Ads in Mozilla Firefox with Stylish


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

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” 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("") {
/* 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 */
#rightCol #pagelet_side_ads,
._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.


  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.


  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.

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

  8. buy coach online stores pyYYrFgH [URL=– – knock off coach bags[/URL – to get new coupon fcgEUgMa [URL=– –– [/URL -

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

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

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

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

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

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

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

  16. get cheap cheap prada handbags RPxVqHxt [URL= – cheap prada handbags[/URL – , just clicks away YptMnkSd [URL= – [/URL -

  17. I am sure you will love replicas aaa NydOskcO [URL=– – faux louis vuitton[/URL – for gift LzStPfjV [URL=– –– [/URL -

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

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

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

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

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

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

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

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

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

  27. order an [URL=http://www.ralph– – ralph lauren online outlet[/URL – for less NjnQwqQo [URL=http://www.ralph– – http://www.ralph– [/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

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

  30. vista [URL= – louis vuitton replicas[/URL – tomar gran descuento KduIIBvl [URL= – [/URL -

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

  32. view [URL= –[/URL – at my estore fBaDplTG [URL= – [/URL -

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

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

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

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

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

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

Leave a Reply

Required fields are marked *.