DEV Community

Cover image for Accepting all invites on LinkedIn
Chris Bongers
Chris Bongers

Posted on • Originally published at daily-dev-tips.com

Accepting all invites on LinkedIn

Suppose you're anything like me and get many invites after posting your LinkedIn handle on Twitter. In that case, you might be wondering if there's not a simple way to accept all of them at once.

LinkedIn used to have the option itself, but for whatever reason, it no longer does.

Luckily we as developers can leverage the power of JavaScript!

TL;DR:

// Open invite page on LinkedIn and paste this in your debug console
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach(button => button.click());
Enter fullscreen mode Exit fullscreen mode

How to accept all invites on LinkedIn at once

First, we need to go to the LinkedIn website and see there are multiple open invites.

LinkedIn multiple invites

The next step is to find out what makes an invite button unique, so we will be using the inspector to find this out.

  • Mac: Cmd + Shift + C
  • Windows: Ctrl + Shift + C

LinkedIn invitation buttons

Here you can see both buttons, the top one being the button to decline an invitation and the bottom one to accept.

The top one has a unique class of button.artdeco-button--tertiary.
The bottom one button.artdeco-button--secondary.

With those two selectors, we can either accept or decline all invites at once!

Let's write a selector to get all the accept buttons.

const buttons = document.querySelectorAll('button.artdeco-button--secondary');
Enter fullscreen mode Exit fullscreen mode

Then we can simply loop over the results and click them.
Making the full function we need to execute in our console tab:

const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach(button => button.click());
Enter fullscreen mode Exit fullscreen mode

And that's it, a super simple way to accept all invites on LinkedIn at once!

LinkedIn console click all invites

Feel free to add me on LinkedIn as well.

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Top comments (5)

Collapse
 
leob profile image
leob • Edited

Nice! Next question is if you really want to, or should, accept all invites ... in my opinion it's often a case of "less is more" with LinkedIn and social media :-)

But well, I realize that this is just an example, and the point you're trying to make is probably a more general one - the realization that you can so easily automate this kind of stuff with a little bit of code is cool!

Collapse
 
dailydevtips1 profile image
Chris Bongers

Ah yes that's another discussion πŸ˜‚
I'm a big fan of networking and get a lot of fellow tech enthusiasts willing to connect.

Collapse
 
daviddalbusco profile image
David Dal Busco

"Report all invites as spam" is the one I need on LinkedIn πŸ˜‰

Nice post Chris πŸ‘

Collapse
 
dailydevtips1 profile image
Chris Bongers

πŸ˜‚ Let's see if we can hack that in

Collapse
 
yangrunkang profile image
yangrunkang

尝试了一下,真ε₯½η”¨