DEV Community

Desmond Gilmour
Desmond Gilmour

Posted on

Automate LinkedIn Invites To Be Withdrawn

All sales begin with Social selling

It's true. Most prospects you interact with nowadays will probably have seen your posts or posts from someone else from your company on LinkedIn. Now, similar to me, I'm guessing you are mass connecting with everyone and their mother from the company you are prospecting... eventually these connection requests begin adding up, and the next thing you know, you have over 2000 pending requests.

Luckily, you can automate the cleanup of these requests.

  1. Navigate to https://www.linkedin.com/mynetwork/invitation-manager/sent/

  2. Open the developer console (right-click and inspect and then choose the console tab)

  3. Enter this snippet of code into the console and wait

var firstButton = document.getElementsByClassName("invitation-card__action-btn artdeco-button artdeco-button--muted artdeco-button--3 artdeco-button--tertiary ember-view")

var secondButton = document.getElementsByClassName("artdeco-modal__confirm-dialog-btn artdeco-button artdeco-button--2 artdeco-button--primary ember-view")

setInterval(()=>{
    for(var i=0;i<firstButton.length;i++){
        firstButton[i].click()
        secondButton[0].click()
    }},1500)

Enter fullscreen mode Exit fullscreen mode

It should look something similar to this.

Console on LinkedIn

If you plan to continue your tasks, this code can run in the background. This code has helped me, whether I am mass-adding recruiters, prospects, or people at companies I would like to work for.

Good luck, and thank you for reading.

Top comments (0)