First I looked for better UI options on LinkedIn.

But truly this script saved me about 12000, clicks.

Really we need a multi-select tool LinkedIn :(. I have premium.

I found an updated version with the most accurate css tags, here. (credit to the gist poster)

Just updated my text to archive and pasted in the console. F12 to open and paste the script there.

The css tags may have been updated since this post(and no longer working), but I will paste my working version here.

You need to scroll down to load all the conversations.. let the script handle archiving, unless it appears to hang.. in which case you may want to delete it by hand.

(function() {
const archiveFn = () => {
let elCard = document.querySelector(".msg-conversation-listitem");
//console.log(elCard);
if (!elCard) {
return setTimeout(() => {
alert("No more message to archive");
}, 250);
}
elCard.click();

setTimeout(() => {
let archived = false;
let dropdownItems = document.querySelectorAll("artdeco-dropdown-item");

for (let i = 0; i < dropdownItems.length; i++) { let txt = dropdownItems[i].textContent.trim(); switch (txt) { // add the word in your language case "Archive": archived = true; dropdownItems[i].click(); break; } } if (!archived) return archiveFn(); setTimeout(() => {
let messageModal = document.querySelector(".msg-conversation-card__toggle-archive-btn");
if (!messageModal) return;

let archiveBtn = messageModal.querySelector(".artdeco-button__icon");
if (!archiveBtn) return;

archiveBtn.click();
archiveFn();
}, 500);
}, 1000);
};

archiveFn();
})();

How I Archived all my messages on LinkedIn, in a pinch.

Leave a Reply

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