Skip to content

Instantly share code, notes, and snippets.

@matale
Created March 28, 2021 11:01
Show Gist options
  • Save matale/8b7c0fd8425c60ebe6db0c08bc82607b to your computer and use it in GitHub Desktop.
Save matale/8b7c0fd8425c60ebe6db0c08bc82607b to your computer and use it in GitHub Desktop.
Script to help automatically delete Saved Jobs on LinkedIn, LinkedIn only allows you to delete 1 job at a time which is a problem when you have hundreds of saved jobs.
// Open Chrome. Not tested on other browsers but should work ¯\_(ツ)_/¯.
// Go to https://www.linkedin.com/my-items/saved-jobs/
// Make sure Saved and not Applied is selected.
// Open the Chrome Dev Tools by hitting F12 on your keyboard.
// Go to Console tab.
// Paste this script in the space bellow after the little > symbol.
// Hit Enter.
// The jobs will start to be deleted 1 by 1 after a 5 sec pause.
// Leave the window open but you can do something else while it does it's thing.
// If it gets tripped up just start over.
// Close or refresh the tab to stop it.
setInterval(function(){
//click on the 3 dots drop down menu
document.getElementsByClassName('artdeco-button--tertiary')[1].click()
var third = document.getElementsByClassName('image-text-lockup__text')[2]
var fourth = document.getElementsByClassName('image-text-lockup__text')[3]
if(third.textContent.includes("Unsave")){
//Job no longer taking applications need to click third item on drop down list
third.click()
}else{
//Job still hiring need to click fourth item on drop down list
fourth.click()
}
//Dismiss the item unsaved popup after waiting 2 seconds for it to appear.
setTimeout(function(){
document.getElementsByClassName('artdeco-toast-item__dismiss')[0].click()
},2000);
},5000);
// Wait 5 seconds between deleting items, seems to work well to give the list enough time to reload after a delete.
@matale
Copy link
Author

matale commented Jun 27, 2021

Tried this again today, it still works the only thing I noticed is that the pagination doesn't advance automatically now I think this is a change on LinkedIn so now once one page is finished deleting you need to click the second page for it to continue.

@adam-rudd-myob
Copy link

this works! Thanks man!

Copy link

ghost commented Jul 18, 2023

you saved me so much time!

@ZiglioUK
Copy link

ZiglioUK commented Jul 24, 2023

Thank you so much, here's a modified version for "Archived" jobs

setInterval(function(){
	//click on the 3 dots drop down menu
	document.getElementsByClassName('artdeco-button--tertiary')[1].click();
	
	ls = document.getElementsByClassName('image-text-lockup__text');
	
	if( ls[2].textContent.includes("Remove job") )
		ls[2].click();
	else
		ls[3].click();
	
	setTimeout(function(){
		document.getElementsByClassName('artdeco-toast-item__dismiss')[0].click()
	},500);
	
},1000); 

@CTravMI
Copy link

CTravMI commented Jul 28, 2023

@ZiglioUK I ran this script but it seems to have caused a glitch where the Archived jobs tab now disappears. How do I stop the script? Closing and refreshing the page didnt' work.

@ZiglioUK
Copy link

How weird, surely refreshing the page would stop any script from running. I don't do much web development, especially in the last 6 years, so I wouldn't know, sorry!

@ZiglioUK
Copy link

Try increasing the timeouts, maybe it's not that the Archived jobs tab has disappeared, perhaps the timeout was too short and the page failed to reload the next bunch of entries. Just hit the back button if that happens

@ZiglioUK
Copy link

@ZiglioUK I ran this script but it seems to have caused a glitch where the Archived jobs tab now disappears. How do I stop the script? Closing and refreshing the page didnt' work.

quick update. If the Archived button disappears, just go to the next page until it reappears (applied jobs come first and don't get archived). In fact, you can just start from the last page.

@samascience
Copy link

Need code for archived jobs too !

@ZiglioUK
Copy link

Need code for archived jobs too !

The code above works well for Archived jobs

https://gist.github.com/matale/8b7c0fd8425c60ebe6db0c08bc82607b?permalink_comment_id=4638902#gistcomment-4638902

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