In this article I will show you how to automatically delete all messages, at once and without installing any plugin.
Whatever the reason could be, in this way you will have the cleanest Messenger chats ever.
Free your mind from the clutter. Offline life is better.
Disclaimers
Disclaimer: It is needed a simple and short script which you should want to understand before running it, because it has the power to mess up with your Facebook account.
Disclaimer: Follow the steps at your own risk. I am not responsible for what your are doing. Are you?
Getting Started
There are three simple steps in between you and the clarity of your Facebook Messenger chats. There is a short script involved, which you will copy and paste into the console of the Developer tools of your browser (Firefox, Chrome) while navigating into the Facebook Messenger page.
In Short, what you will be doing:
- Get the script.
- Go to the Facebook Messenger.
- Run the script within the browser.
1. Get the script
Copy in your clipboard the code of the most recent version of the script from github, or try your luck with this one:
var pleaseRemoveDiscussionPlease = function () {
var clickElement = function(elem) {
elem.style.border = "thick solid red";
elem.click();
}
var confirmDeleteDiscussion = function(idx) {
[...document.querySelectorAll('div[role="dialog"] button')].forEach( (a) => {
if (a.innerHTML === "Delete") {
clickElement(a);
}
});
setTimeout(removeDiscussion, 5000, idx);
}
var deleteDiscussion = function(idx) {
[...document.querySelectorAll('li[role="presentation"] > a[role="menuitem"] > span > span')].forEach( (a) => {
if (a.innerHTML === "Delete") {
clickElement(a);
}
});
setTimeout(confirmDeleteDiscussion, 2000, idx);
}
var removeDiscussion = function() {
var elem = [...document.querySelectorAll('div[aria-label="Actions"] > div > div[aria-label="Conversation actions"]')][0];
if (elem) {
clickElement(elem);
setTimeout(deleteDiscussion, 600);
} else {
clearTimeout();
console.log('DONE. Now drop a message to somebody on Signal and have a walk together.');
}
};
removeDiscussion();
}
2. Go to the Facebook Messenger
- Go to the Facebook Messenger page.
- Scroll down entirely until all of your chats are visible in the left column.
3. Run the script within the browser
- Press
F12
to open the Developer tools window (Firefox, Chrome). - Select Console.
- Read the security concerns message that the Facebook developers left for you.
- Paste the script into the prompt of the console
- Type
pleaseRemoveDiscussionPlease()
, hit return, and wait until it’s done.
If this article was useful to you, please share it using your favorite way for doing it! If you have suggestions of improvement or you’ve found something wrong, please let me know!