We will be using the below script to withdraw all the pending invites.
Script
javascript:(function(){var i=0;var f=function(){let l=document.querySelector("*[data-control-name=withdraw_single]");if (!!l){setTimeout(function(){l.click();}, 100);setTimeout(function(){document.querySelector(".artdeco-modal .artdeco-button--primary").click();},1500);setTimeout(function(){f();},2500);}};f();})()
Step 1: Add this script to your Chrome Browser
Open Bookmarks Manager in your Chrome Browser. To open Bookmark Manager, click on the 3 dots on the top right corner of your chrome browser and click on Bookmarks -> Bookmark Manager. (Shortcut: For Windows: Ctrl+Shift+O, For Mac: Cmd+Option+B)
Click on the 3 dots on the top right corner of the bookmarks page, and select Add New Bookmark.
Name this Bookmark as LinkedIn Withdraw Invites Button.
Below that you will find another field called URL. Paste the script from the top of this article in the URL field.
And finally, click on Save Button.
Step 2: Execute this script on LinkedIn
First, you need to open LinkedIn Invitation Manager or navigate to https://www.linkedin.com/mynetwork/invitation-manager/sent/ and click on Sent to see all the pending invites.
Click on LinkedIn Withdraw Invite Button that we created in the previous steps.
This will start the script and the withdrawal process will be started.
IMPORTANT: To stop this script simply refresh the LinkedIn page and that will stop the script