← All examples

JavaScript Ads & clutter facebook.com

Facebook: hide "Suggested for you" posts

Removes "Suggested for you" injections from the feed, leaving only posts from people you follow.

Code to copy

// Hide "Suggested for you" posts injected into the feed
function hideSuggested() {
  const markers = ['Suggested for you', 'Proponowane dla Ciebie', 'Vorschläge für dich',
    'Suggéré pour vous', 'Suggerito per te', 'Sugerido para ti',
    'Рекомендуем вам', '为你推荐'];
  document.querySelectorAll('[role="feed"] [role="article"]').forEach(function (post) {
    if (post.dataset.jzSuggestChecked) { return; }
    post.dataset.jzSuggestChecked = '1';
    const text = post.textContent || '';
    if (markers.some(function (m) { return text.indexOf(m) !== -1; })) {
      post.style.display = 'none';
    }
  });
}
hideSuggested();
new MutationObserver(hideSuggested).observe(document.body, { childList: true, subtree: true });

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Paste the code into the rule's JavaScript panel and save — it runs on every page visit.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases