See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.
- Open news feed preferences on your Facebook menu (browser)
- Click people or pages
- Scroll down (or click see more) until your full list is loaded
- Run the script in your browser console
Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.
@COFFEEHOLIC47 It's because you have no liked pages ("Nothing to show" is said in the screenshot). In other words, the script worked, it just didn't do anything because there's nothing to do. If you're trying to unfriend/unfollow friends (not pages), I don't have a working script for that, and as I told [zeeatsh] in my latest reply, I have no possible way of doing it with Javascript (at least, as far as I am aware of).