Home » How to Hide Political Posts from Facebook

How to Hide Political Posts from Facebook

Have you ever wanted to hide all the political posts from your Facebook feed without having to unfriend anyone or put your friends into groups? This post will show you how to hide political posts from Facebook while also giving you the option to temporarily toggle them on one post at a time.

I wrote this script after a receiving a few personal attacks on Facebook so I could quickly have a way to hide all the nonsense while maintaining my friendship with people from my past that have different political views. It currently is tailored to use a set of keywords that are geared towards blocking posts from the 2016 political season, but you can feel free to change these to your liking. Let’s dive into it!

This tutorial is for Chrome but this can also work in Firefox and any other browser that has the Tampermonkey browser extension…

How to Hide Political Posts from Facebook

  1. Download and install the Tampermonkey browser extension for your browser. A Google search for “tampermonkey chrome” or “tampermonkey firefox” etc. should do the trick.
  2. Once that’s installed, open up the Tampermonkey dashboard by clicking on the little Tampermonkey icon:
    Open Tampermonkey Dashboard
  3. Once you’re in the dashboard, click on the tab with the plus icon so you can create a new Tampermonkey script:
    Create New Tampermonkey Script
  4. Highlight all the code in the box below and delete it. Then replace it with the following code:
    UPDATE: special thanks to the email request from Louis Debroglie to update this code to work on the latest Facebook UI update



  5. Once you’re all done, click the little save/disk icon on the top left of the Tampermonkey window. Once you see a message at the top that says “Operation completed successfully” you can close the Tampermonkey tab.
  6. Now open up a Facebook tab (if you already have a Facebook tab open, go back to that tab and refresh it). You should now see political posts being hidden as you scroll through your news feed or any feed section on Facebook. It will tell you which buzz word it contained and who posted the post, and will allow you to click the hidden post to toggle it on in case you’re feeling temporarily political or you think it might have been hidden incorrectly.
    How to Hide Political Posts from Facebook
Note: If someone’s name contains these political buzz words and they commented on the post, it will hide the post.

Again, this is a simple tutorial on how to hide political posts from Facebook. This solution will not work perfectly for everyone because some people will not want to hide posts that contain the same words as I would like hidden, but it’s a good start for learning how to script for Facebook to improve your user experience. If you’re looking to tailor this to your specific needs, feel free to comment below with what you’re trying to accomplish. I’m always willing to help 🙂

2 comments on “How to Hide Political Posts from Facebook

    • Jeff Hays on

      It still works currently to this day actually. I’m still using it right now and have even updated the script to show the percentage of posts it has hidden from containing political content. I’m sorry you had troubles using TamperMonkey. I have 3 friends that are not computer savvy that have used this tutorial to successfully install the script. Perhaps if you provide some (any) information about what you’ve tried to troubleshoot the script I could help you figure out what’s going on. Do you have any errors in your console? Can you provide any feedback as to what you tried? Have you used TamperMonkey before? Did you confirm the script is executing by checking your JS console?


Leave a Reply

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