facebook delete all messages button

I find it really really anoying that facebook removed the “Delete All” button.
For me its clear that they do not want anyone to remove the messages, so they
can sell this information to anyone who is willing to pay and make adds.
Well I found the solution, using Chrome
Click on the INSTALL on this page:
In case they remove it from that site I keep the code down here:
// ==UserScript==
// @name Facebook: Message quick-delete buttons
// @description Adds a direct delete button to message threads and replace the “archive” button with a immediate delete button.
// @namespace privacyplease
// @include http://*.facebook.com/*
// @include https://*.facebook.com/*
// @require http://code.jquery.com/jquery-1.3.2.min.js
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement(“script”);
script.setAttribute(“src”, “http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”);
script.addEventListener(‘load’, function() {
var script = document.createElement(“script”);
script.textContent = “(” + callback.toString() + “)();”;
}, false);
function switchDeleteButtons() {
var q = jQuery;
// Restore global $ variable for sanity.
var running = false;
var run = function() {
if (running) return;
if (!document.getElementById(“MessagingDashboard”)) return;
running = true;
try {
if (document.getElementById(“MessagingShelf”)) {
// console.log(“Detected MessagingShelf.”);
if (!document.getElementById(“QuickDelete”)) {
var actions = q(“#MessagingFrame”).find(‘form[class~=”uiHeaderActions”]’);
var tid;
actions.find(‘input[name=”tid”]’).each(function() {
// console.log(“Have tid:”+q(this).attr(“value”));
if (tid) {
var elem = q(‘Delete All‘);
// console.log(elem, actions.find(‘div[class~=”uiToolbarContent”]’));
} else {
// console.log(“Looking for archive buttons to replace.”);
// Avoid false positives by class and structure matching. Better than URLs.
q(document).find(‘li[class~=”threadRow”]’).each(function() {
q(this).find(‘a[class~=”archiveLink”]’).each(function() {
var a = q(this);
var url = a.attr(“ajaxify”);
url = url.replace(“action=tag&”,”action=delete&”);
a.attr(“ajaxify”, url);
a.find(‘input’).attr(“value”, “D”);
var l = a.find(‘label[class~=”uiCloseButton”]’);
var old = l.attr(“class”);
if (old) {
l.attr(“class”, old.replace(“uiCloseButton”, “uiDeleteButton”));
}catch(e){console.log(“Exception:”, e);};
running = false;
jQuery(document).bind(“DOMNodeInserted”, run);
// load jQuery and execute the main function

One thought

Leave a Reply

Your email address will not be published. Required fields are marked *