Hide Facebook ‘Like’ News

If you use Facebook, you’ve probably seen entries like this in your news feed. facebook_like_newsThey seem to just be popular posts from pages that your friends ‘like’. I find them to generally be irrelevant, so I made a user script to hide them.

It was an interesting opportunity to poke around the Facebook frontend JavaScript code. I also tried out MutationObservers and built my knowledge of XPath, which is very powerful.

Code is in the Hide_Facebook_Like_News.user.js Gist, which also explains how to use it:

3 thoughts on “Hide Facebook ‘Like’ News

  1. Adam

    Hello, where we need to implement this code? Is it some browser addon or we need to put it somewhere in Facebook account settings?

    Thanks a lot,

    1. andrew Post author

      Hi Adam,

      It’s a browser user script so it works as a kind of addon, but really it’s just a script that either the browser (or a user script runner addon) injects into certain pages based on the @include directive.

      There are some instructions for adding user scripts to Chrome here: http://stackoverflow.com/questions/5258989/manually-adding-a-userscript-to-google-chrome or for Firefox use you can use an addon like Greasemonkey.

      Problem is, similar to screen-scrapers it’s working with the HTML DOM so if Facebook decide to change their layout it might stop working – YMMV.



Leave a Reply

Your email address will not be published. Required fields are marked *