Skip to content

Instantly share code, notes, and snippets.

@DBJDBJ
Last active December 16, 2022 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DBJDBJ/3925dd9ae7d9a9f07338c647e771750f to your computer and use it in GitHub Desktop.
Save DBJDBJ/3925dd9ae7d9a9f07338c647e771750f to your computer and use it in GitHub Desktop.
Clean All Your Linked IN Connections With A Script

Very big Warning:

If you do not know (or have a faintest clue) what is "Chrome Dev Console" please do not attempt deleting your LinkedIN connections using the script presented here.

Please consider purchasing a very powerfull but user friendly LINKED IN HELPER.

Or find a friend who can understand this text. Or just give up until you do. If not sure what are you doing here, please do not try on your own, anything described. Just leave.

Script to delete ALL connections on your LinkedIN account

Use Google Chrome browser. Login to your LinkedIN account. Go to the page:

https://www.linkedin.com/mynetwork/invite-connect/connections/

A bit of an explanation, for the developers:

$('[data-control-name="ellipsis"]').click();

Above finds all the '. . .' buttons on the page where connections are listed, it returns the firsts one and call the click event on it. If you click on any o them the next intermediate button pops up, probably just to make the removal a bit more tedious

// notice two spaces after remove
$('[aria-label="Remove  from connections"]').click();

After calling a click on the first ellipsis button found, above provokes "Remove Connection" pop-up, with button "Removed" that can be selected with and clicked on with the following jquery line:

$('button[data-control-name="confirm_removed"]').click()

Thus the final script is:

var JQ = $ ;
// for every contact
setInterval( function () {
// this provokes the click on '...'
JQ('[data-control-name="ellipsis"]').click();

// wait on second then provoke a click on "Remove from connections"
setTimeout(function(){ }, 1000);
JQ('button[aria-label="Remove  from connections"]').click(); 

// wait one second
setTimeout(function(){ }, 1000);
JQ('button[data-control-name="confirm_removed"]').click(); 
} , 1000 ) ;

Open the dev console with key F12 and use this script.

It will remove all the connections one by one (inside 3 seconds per each), and will proceed running indefinitely. Just kill the browser and open it again.

This works as of 2020-FEB-01

© 2020 by dbj@dbj.org, Licence CC BY SA 4.0

@karthikone
Copy link

Got this error 👇:

Uncaught TypeError: Cannot read properties of null (reading 'click')
at :5:37

@DBJDBJ
Copy link
Author

DBJDBJ commented Dec 16, 2022

Because that page has changed.

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