Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple way to unlike all facebook page in one time !

How to unlike all Facebook page at once

If you want to do cleaning on your Facebook timeline, you may want to unlike all Facebook pages quickly. There is a way for that :

  • Go to firefox and install iMacros
  • Open a text editor (i.e. Notepad, Sublime Text), and paste that code inside :
VERSION BUILD=7401110 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=SPAN ATTR=TXT:Unlike
TAG POS=2 TYPE=SPAN ATTR=TXT:Unlike
TAG POS=3 TYPE=SPAN ATTR=TXT:Unlike
TAG POS=4 TYPE=SPAN ATTR=TXT:Unlike
TAG POS=5 TYPE=SPAN ATTR=TXT:Unlike
WAIT SECONDS=1
  • Save with .iim extension at C:\Users\YouUsername\Documents\iMacros\Macros for Windows or /Users/YourUsername/iMacros/Macros for OsX
  • Go to Facebook (logged) on that page
  • Open iMacros and launch the script, repeat it more needed (i.e. 9999).
  • Because of infinite scrolling from Facebook, you may repeat it few time.
  • You're welcome !
@hexeno

This comment has been minimized.

Copy link

@hexeno hexeno commented Oct 4, 2015

The facebook link doesn't work.

@philippebarbosa

This comment has been minimized.

Copy link
Owner Author

@philippebarbosa philippebarbosa commented Nov 12, 2015

@hexeno that version doesn't work anymore. I'm looking forward a new way to do it.

@saoodsaboor

This comment has been minimized.

Copy link

@saoodsaboor saoodsaboor commented Feb 24, 2016

Just go to your likes page and start imacros script

VERSION BUILD=7401110 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=BUTTON ATTR=TXT:Liked
WAIT SECONDS=1
TAG POS=1 TYPE=SPAN ATTR=TXT:Unlike

Regard
http://apksafe.com/

@mohsenuss91

This comment has been minimized.

Copy link

@mohsenuss91 mohsenuss91 commented Dec 1, 2017

Thanks, I would like to know how to unlike facebook inactive pages ? (from a specific date, one year for example)

@mattmarcum

This comment has been minimized.

Copy link

@mattmarcum mattmarcum commented Feb 12, 2018

Here's something you can just run from the console: https://gist.github.com/mattmarcum/92cff950e25fa5f39f5fc05f1b22c75f

@digggggggggg

This comment has been minimized.

Copy link

@digggggggggg digggggggggg commented Jan 29, 2019

I wrote a script to automatically unlike all things.
don't use this if you don't know what it does, use at your own risk, etc

  1. go to https://www.facebook.com/browse/other_connections_of/
  2. open console and execute the code below.
const unlike_all = ()=> {
	[].slice.call(document.querySelectorAll('a[role=button]')).filter(x=>x.innerText=='Unlike').map(x=>{x.click(); x.remove()});
	[].slice.call(document.querySelectorAll('a[role=button][action=cancel]')).map(x=>x.click());
	window.scrollTo(0,document.body.scrollHeight);
	window.setTimeout(unlike_all, 3 * 1000)
};
unlike_all();

The script will unlike all pages, scroll to the bottom of the page, unlike all the new items in the list, scroll down again, unlike again, until there is nothing left to unlike.

don't use this if you don't know what it does, use at your own risk, etc

@digggggggggg

This comment has been minimized.

Copy link

@digggggggggg digggggggggg commented Jan 29, 2019

Here's something you can just run from the console: https://gist.github.com/mattmarcum/92cff950e25fa5f39f5fc05f1b22c75f

that gist doesn't scroll down the page so you have to paste and run over and over again, that's why I wrote the above. Hope it helps.

@elmalto

This comment has been minimized.

Copy link

@elmalto elmalto commented Sep 14, 2019

For me, it worked to go to https://www.facebook.com/pages/?category=liked

and run

var unlike_all = ()=> {
	[].slice.call(document.querySelectorAll('button')).filter(x=>x.innerText.indexOf('Liked') !=-1).map(x=>{x.click()});
	window.scrollTo(0,document.body.scrollHeight);
	window.setTimeout(unlike_all, 3 * 1000)
};
unlike_all();
@BillTribble

This comment has been minimized.

Copy link

@BillTribble BillTribble commented Sep 20, 2019

Hey thanks @elmalto, this works great!
Can anyone figure out how to 'Unlike' ALL activity? I've been experimenting on the 'Activity log' page but can't figure it out (I'm no JS dev!)

@magusverma

This comment has been minimized.

Copy link

@magusverma magusverma commented Oct 5, 2019

elmato's script worked like a charm

@tiagoad

This comment has been minimized.

Copy link

@tiagoad tiagoad commented Oct 26, 2020

Here's something that works with the newest version. You need to change "Liked" to your local language.

var unlike_all = ()=> {
	[].slice.call(document.querySelectorAll('span')).filter(x=>x.innerText.indexOf('Liked') !=-1).map(x=>{x.click()});
	window.scrollTo(0,document.body.scrollHeight);
	window.setTimeout(unlike_all, 3 * 1000)
};
unlike_all();
@trievis

This comment has been minimized.

Copy link

@trievis trievis commented Oct 28, 2020

The script should work with following modification:

var unlike_all = ()=> {
	[].slice.call(document.querySelectorAll('[aria-label="Liked"')).filter(x=>x.innerText.indexOf('Liked') !=-1).map(x=>{x.click()});
	window.scrollTo(0,document.body.scrollHeight);
	window.setTimeout(unlike_all, 3 * 1000)
};
unlike_all();
@OriginalJef

This comment has been minimized.

Copy link

@OriginalJef OriginalJef commented Oct 28, 2020

If you also want to decline all page like requests: https://gist.github.com/OriginalJef/83381ed15437fc396b27dfc871f48cb8

@erubenz

This comment has been minimized.

Copy link

@erubenz erubenz commented Mar 24, 2021

I tried the script and it deletes only active pages, deleted once stays in likes section. Is it possible to remove them too? Thanks

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