Skip to content

Instantly share code, notes, and snippets.

@renestalder
Last active November 6, 2025 18:29
Show Gist options
  • Select an option

  • Save renestalder/c5b77635bfbec8f94d28 to your computer and use it in GitHub Desktop.

Select an option

Save renestalder/c5b77635bfbec8f94d28 to your computer and use it in GitHub Desktop.
Unfollow all on Facebook

Facebook: Unfollow people and pages

See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.

  1. Open news feed preferences on your Facebook menu (browser)
  2. Click people or pages
  3. Scroll down (or click see more) until your full list is loaded
  4. 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.

var unfollowButtons = document.querySelectorAll('[data-followed="1"]'); for(var i=0;i<unfollowButtons.length;i++){ unfollowButtons[i].click(); } alert(unfollowButtons.length+' people are now unfollowed! ');
@Makharaa
Copy link

Makharaa commented Nov 5, 2025

@matsyui it does not work
Untitled

@matsyui
Copy link

matsyui commented Nov 5, 2025

@matsyui it does not work Untitled

For processOneProfile try to update the div.x78zum5.x1q0g3np.x1a02dak.x1qughib > div with your own selector.

test

@Makharaa
Copy link

Makharaa commented Nov 5, 2025

@matsyui It works on pages but doesn't unfollow persons. It gives me the error unfollow dialog not found.

@matsyui
Copy link

matsyui commented Nov 6, 2025

@matsyui It works on pages but doesn't unfollow persons. It gives me the error unfollow dialog not found.

You have to update this div.x78zum5.x1q0g3np.x1a02dak.x1qughib > div to your own elements

Step 1. right click name then click inspect element
image

Step 2. Find your selector
image

@daokethinh-tech
Copy link

image I am getting this error how to solve it?

@matsyui
Copy link

matsyui commented Nov 6, 2025

image I am getting this error how to solve it?

  1. Is your internet good? try increasing HOVER_WAIT_TIMEOUT
  2. Is your selector setup? Read the one above. should be like div.XXXXX.XXXXX.XXXX.XXXXX > div

@daokethinh-tech
Copy link

ảnh Tôi gặp lỗi này làm thế nào để giải quyết nó?

  1. Internet của bạn có tốt không? Thử tăng HOVER_WAIT_TIMEOUT
  2. Bộ chọn của bạn đã được thiết lập chưa? Đọc một ở trên. nên giống như div.XXXXX.XXXXX.XXXX.XXXXX > div

My internet is 100mb/s very good, has set the filter on Tampermonkey. Can you support me with Teamview or Ultraview? Thank you very much!
image

@matsyui
Copy link

matsyui commented Nov 6, 2025

ảnh Tôi gặp lỗi này làm thế nào để giải quyết nó?

  1. Internet của bạn có tốt không? Thử tăng HOVER_WAIT_TIMEOUT
  2. Bộ chọn của bạn đã được thiết lập chưa? Đọc một ở trên. nên giống như div.XXXXX.XXXXX.XXXX.XXXXX > div

My internet is 100mb/s very good, has set the filter on Tampermonkey. Can you support me with Teamview or Ultraview? Thank you very much! image

Do the step 2, after that paste the script in the console.

I dont do remote view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment