Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Add Official LinkedIn Share Button in WordPress

Last updated on by
Follow WPBeginner on YouTube
How to Add Official LinkedIn Share Button in WordPress

Just like Twitter Retweet Button, Facebook Like Button, and Facebook Share Button, Business-oriented social network LinkedIn has launched their own share button, which gives publishers a way to spread their content on LinkedIn and enables users to easily share content with their LinkedIn network. In this article, we will show you how you can quickly add the LinkedIn Share Button in WordPress.

LinkedIn Share Button

To add the Official Linkedin Share button simply open up a theme file of your choice (single.php etc) and add the following code within the Post Loop:

Vertical Count

Vertical count display will show the count on top of the button as displayed in the preview image.

<script type="text/javascript" src=""></script><script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="top"></script>

Horizontal Count

Horizontal count will display the count to the right of the button, which can be seen in the image preview above.

<script type="text/javascript" src=""></script><script type="in/share" data-url="<?php the_permalink(); ?>" data-counter="right"></script>

No Count

<script type="text/javascript" src=""></script><script type="in/share" data-url="<?php the_permalink(); ?>"></script>

Because this was announced recently, there are no plugins for this yet. But we are certain that developers will be releasing them soon. If you are a developer who have a plugin in works, then please keep us updated, so we can add it in this post.

Additional Resources

Official Page for Publishers

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. sinhrakesh says:

    I used below codes in the Custom Codes section to add Google+ and Linkedin Share buttons on my WP Blog (


    <div class=”sharer”><script type=”text/javascript” src=””></script> <g:plusone size=”tall”></g:plusone></div>


    <div class=”sharer”><script type=”text/javascript” src=””></script><script type=”in/share” data-url=”<?php the_permalink(); ?>” data-counter=”top”></script></div>

    Google+ Button is working fine but Linkedin Share isn’t getting the desired result upon clicking… Can you please advise whats wrong where?

  2. wpbeginner says:

    @ThomasRand-Nash No you cannot.

  3. ThomasRand-Nash says:

    can you change the sizing of the like button?

  4. Crysislevel says:

    buttons tutorials are my fav. unfortunately i dont use linkedin that much! :(

  5. wpbeginner says:

    @SJCParis No you cannot use this on free sites…

  6. SJCParis says:

    Can I put this button on a free wordpress blog?

  7. wpbeginner says:

    You are welcome. Yes horizontal one works great, but if you have a floating share box like ours, then the vertical share box is good too.

  8. Kavita says:

    Thanks for the code. I like the horizontal with count ideal for my blog.

  9. Jeremy Victor says:

    can you tell me how to add this LinkedIn share button to your Smart Sharing plugin?


    • Editorial Staff says:

      Copy and paste the LinkedIn script code that we share in this article in the custom code section…

      • Holly says:

        Thanks for this. I pasted the code in the custom code section, but it’s not working…says “there’s a problem performing this action.” Any help would be greatly appreciated.

  10. Keith Aul says:

    I’m not to sure what you mean by the following?
    To add the Official Linkedin Share button simply open up a theme file of your choice (single.php etc) and add the following code within the Post Loop

    I don’t want to break anything on my site so I want to be sure I’m able to find the right file and open/edit it. Where would I find the theme file in my dashboard and where in the file do I post the code?

    • Editorial Staff says:

      You will find the theme file in your theme’s folder wp-content/themes/yourthemename/ < Editor and edit single.php file. If you have no knowledge regarding WordPress, then we recommend that you wait till a plugin comes out.

  11. brad dalton says:

    How long do you think it will take to build a plugin?

    • Editorial Staff says:

      Plugins are probably built and are in the review process to get live in the repository.

  12. Dana says:

    Thanks, great article! Where’s your share button? ;)

  13. Piet says:

    Finally LinkedIn did this, a week too late though, but I managed to make something similar for myself.
    Next time I need it, I will just grab your code, thanks!

  14. Eleanor says:

    I am not a developer, but I found this plugin a few minutes ago. Thank you for the tutorial!

    • Editorial Staff says:

      This plugin does not have the count option available.

    • Jose Joel says:

      The Share This Plugin have the option to add the LinkedIn Button as simple as writing linkedin the editing section of the plugin…and this one have count… ;)

      Note: I’m not the developer of this plugin, neither work for them, I’m only a regular user… :)

  15. Jon Bishop says:

    I’m happy LinkedIn finally did this. I tried to use their API to make my own for the Socialize plugin but it ended up being a pain. I was able to finally use this code to update the plugin with the new LinkedIn button.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.