How I used javaScript to remove all my Linkedin connections automatically.






I was really concerned about my Linkedin profile because lately I had added a lot of random people who were spamming everything. So, I decided to remove them, but as I approached this was a pain in neck because linkedin does not provide any such option to remove people in bulk. I tried manually but it turned out 3 step process for each connection.





First, click the options near the connection.





Secondly, click remove connection.





Third, accept the prompt which says "are you sure ....!".





So, if I multiply 3 with the number of connections I had to remove, it was case impossible.





But wait.....!





These are just three steps that need to be done....right?





Why not try a script?





I did. It worked.





How ?





Simple. Just go to https://www.linkedin.com/mynetwork/invite-connect/connections/





Open javaScript console in your browser. I am on chrome (Linux) , so fn+f12.





Paste this code:





setInterval(() => {

document.querySelectorAll("[data-control-name=ellipsis]")[0].click()

document.querySelectorAll("[type=trash-icon]")[0].click()

document.querySelectorAll("[data-control-name=confirm_removed]")[0].click()

}, 500);




This clicks the ellipsis button, clicks the Remove Connection button, and clicks the Remove button to confirm the removal. It clears about 10 connections a second.





Amazing, just grab yourself a cup of coffee and sit back , relax.





Note: Sometimes LinkedIn will be slow to update, so next time you go, it might still say you have X connections. Just run this a few times until the number drops to 0 or whatever number you want.


Post a Comment

Post a Comment (0)

Previous Post Next Post