-
-
Save mi-lee/54a781dea746b947f36d8544682d3cdf to your computer and use it in GitHub Desktop.
// DISCLAIMER: I'VE ONLY RUN THIS SCRIPT ON MY OWN ACCOUNT ONLY. PROCEED/USE WITH RISK! I MADE THIS SCRIPT IN 20 MINUTES SO BE WARNED! | |
// On the other hand, I've deleted 50,000 comments in a matter of minutes so it's been pretty damn handy | |
// 1. Go to Activity feed, like facebook.com/<username>/allactivity | |
// 2. Navigate to specific section of FB, like "Likes and Reactions" or "Comments", | |
// like https://www.facebook.com/<username>/allactivity?privacy_source=activity_log&log_filter=cluster_<clusterid> | |
// 3. Navigate to year that you want to batch delete. You may need to scroll a little bit to let it load | |
// 4. Once you enter this there's no going back!! | |
// deletes, hides, and unlikes posts all within a specific year (in options.year) | |
function delete_hide_unlike(options) { | |
var rows = document.querySelectorAll('#facebook #year_' + options.year + ' ._42fu'); | |
for (var k = rows.length - 1; k >= options.limit; k--) { | |
var row = rows[k]; | |
var rowButton = row.click(); | |
var editButtons = document.querySelectorAll('._54nh'); | |
for (var j = editButtons.length - 1; j >= options.limit; j--) { | |
var editButton = editButtons[j]; | |
if (!editButton) { | |
console.log('Nope!'); | |
break; | |
} | |
if (editButton.textContent == 'Delete') { | |
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING | |
console.log("DELETED"); | |
} else if (editButton.textContent == 'Hidden from timeline') { | |
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING | |
console.log("HIDDEN"); | |
} else if (editButton.textContent == 'Unlike') { | |
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING | |
console.log("UNLIKE"); | |
} else { | |
console.log("IGNORED") | |
} | |
} | |
} | |
} | |
var options = { | |
year: '2007', | |
limit: 0, // use 1000 if you want to throttle how much to delete | |
} | |
delete_hide_unlike(options); | |
// unlikes and deletes anything that is globally public, by year (set in options.year) | |
function unlike_delete_globally_public_posts(options) { | |
var rows = document.querySelectorAll('#year_' + options.year + ' *[aria-label="Public"]') | |
for (var i = 0; i < rows.length; i++) { | |
var global_like = rows[i] | |
var likeButton = global_like.parentElement.parentElement.parentElement.querySelector('._42fu') | |
likeButton.click(); | |
var editButtons = document.querySelectorAll('._54nh'); | |
for (var j = editButtons.length - 1; j >= options.limit; j--) { | |
var editButton = editButtons[j]; | |
if (!editButton) { | |
console.log('Nope!'); | |
break; | |
} else if (editButton.textContent == 'Delete') { | |
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING | |
console.log("DELETED"); | |
} else if (editButton.textContent == 'Unlike') { | |
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING | |
console.log("UNLIKE"); | |
} else { | |
console.log("No action") | |
} | |
} | |
} | |
} | |
var options = { | |
year: '2009', | |
limit: 0 // use 1000 if you want to throttle it | |
} | |
unlike_delete_globally_public_posts(options) |
Can someone please show me how this is supposed executed in console, I copied and pasted into console but i think the reason its not working is because i might be adding text that i shouldn’t be?
// deletes, hides, and unlikes posts all within a specific year (in options.year)
function delete_hide_unlike(options) {
var rows = document.querySelectorAll('#facebook #year_' + options.year + ' ._42fu');
for (var k = rows.length - 1; k >= options.limit; k--) {
var row = rows[k];
var rowButton = row.click();
var editButtons = document.querySelectorAll('._54nh');
for (var j = editButtons.length - 1; j >= options.limit; j--) {
var editButton = editButtons[j];
if (!editButton) {
console.log('Nope!');
break;
}
if (editButton.textContent == 'Delete') {
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING
console.log("DELETED");
} else if (editButton.textContent == 'Hidden from timeline') {
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING
console.log("HIDDEN");
} else if (editButton.textContent == 'Unlike') {
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING
console.log("UNLIKE");
} else {
console.log("IGNORED")
}
}
}
}
var options = {
year: '2007',
limit: 0, // use 1000 if you want to throttle how much to delete
}
delete_hide_unlike(options);
// unlikes and deletes anything that is globally public, by year (set in options.year)
function unlike_delete_globally_public_posts(options) {
var rows = document.querySelectorAll('#year_' + options.year + ' *[aria-label="Public"]')
for (var i = 0; i < rows.length; i++) {
var global_like = rows[i]
var likeButton = global_like.parentElement.parentElement.parentElement.querySelector('._42fu')
likeButton.click();
var editButtons = document.querySelectorAll('._54nh');
for (var j = editButtons.length - 1; j >= options.limit; j--) {
var editButton = editButtons[j];
if (!editButton) {
console.log('Nope!');
break;
} else if (editButton.textContent == 'Delete') {
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING
console.log("DELETED");
} else if (editButton.textContent == 'Unlike') {
editButton.click(); // COMMENT OUT IF YOU WANT TO TEST IT OUT WITHOUT ACTUALY DELETING
console.log("UNLIKE");
} else {
console.log("No action")
}
}
}
}
var options = {
year: '2009',
limit: 0 // use 1000 if you want to throttle it
}
unlike_delete_globally_public_posts(options)
@mi-lee Hello :) I have tried all scripts but it's not working. I think it needs an update to the new Facebook, Could you please recheck the script? I just need interactions (post likes/comment likes) remover. Thanks in advance :)
@Meligy Hello :) the script you wrote is not working, could you please update it, just specific to the year (not specific to a date)? It gave me undefined result, as of a specific date too. Thanks!
Wish I'd had this years ago; I tried all sorts of plugins and scripts to delete FB activity, and some of them worked quite well -- for a short time, until Zucky changed the code so they wouldn't work. Moot point now, though, because I finally utilized the nuclear option and deleted my FB, Insta, and WhatsApp about six months ago. You can do it, too! :)