To add LinkedIn’s official share button to WordPress, embed LinkedIn’s JavaScript Share Plugin where you want the button to appear. For a button on every post, generate its data-url from that post’s permalink; a fixed URL would make every button share the same page.
Choose where the button should appear
LinkedIn’s official Share Plugin uses a JavaScript file and an IN/Share element. Its data-url value identifies the page to share. LinkedIn also permits leaving that value blank so visitors can choose what to share. See LinkedIn’s Share Plugin documentation, last updated May 8, 2023.
As an Amazon Associate I earn from qualifying purchases.
- One page: Add the embed to that page and set
data-urlto its public URL. - Every post: Use WordPress PHP to insert the embed and supply the current post’s permalink dynamically.
Add the button to a single page
In the page’s HTML, place LinkedIn’s embed where the button should appear, replacing the example URL with the page’s public URL:
<script src="https://platform.linkedin.com/in.js" type="text/javascript">lang: en_US</script>
<script type="IN/Share" data-url="https://example.com/article/"></script>
Use a URL that visitors can access without logging in. If you omit data-url, LinkedIn’s documentation says visitors can craft their own shares.
#1 Best Overall
- Decorate your car, truck, laptop, or window and stand out from the crowd with this holographic LinkedIn icon sticker. Rainbow material changes colors, depth, and variations depending on lighting and angles.
- Icon is cut from weatherproof holographic vinyl. Durable, long lasting material will withstand prolonged use through all the elements. Sticker is car wash safe.
- This set includes one 5 by 5-inch sticker, perfect for advertising your social media presence. Add your own handle or business name; use on company vehicles. Look for our custom social media products for more options.
- Decals come with a layer of transfer tape already applied for easy application. Detailed use and care instructions are included. Use on glass, metal, plastic, etc. Not recommended for painted surfaces.
- All decals are designed and manufactured in the United States.
Show the current post’s URL on every post
For recurring posts, the key is to create the embed in a PHP context and use get_permalink(). The following illustrates the pattern in a content filter:
add_filter( 'the_content', function ( $content ) {
if ( ! is_singular( 'post' ) || ! in_the_loop() || ! is_main_query() ) {
return $content;
}
$share_button = '<script src="https://platform.linkedin.com/in.js" type="text/javascript">lang: en_US</script>';
$share_button .= '<script type="IN/Share" data-url="' . esc_url( get_permalink() ) . '"></script>';
return $content . $share_button;
} );
This example appends the button to the main content of individual posts. To place it before the post, change the return line to return $share_button . $content;. The is_singular( 'post' ) check limits it to standard posts; adjust that condition if the button should also appear on a custom post type.
Rank #2
- High-performance vinyl that features a super-strong adhesive
- Personalized: Enter your personalization using the customize now tool
- High quality, full-color printing that is made to order
- Weatherproof, Scuff-proof, Tear-resistant
- Print sheet size: 17.45in x 3in
PHP must run in a PHP execution context. Pasting this snippet into an ordinary paragraph or WordPress HTML block will display code or markup rather than execute the PHP. WPBeginner’s WordPress walkthrough demonstrates managing a snippet with WPCode instead of editing a theme’s functions.php; a snippet manager is an optional convenience, not a LinkedIn requirement. Confirm your snippet runs only on the content you intend, then view a post on the public-facing site and check that its button points to that post’s URL.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteCheck the LinkedIn preview separately
The button starts the sharing flow, but the title, description, and image shown in a share preview depend on what LinkedIn can retrieve from the page. LinkedIn’s shareability guidance calls for Open Graph tags including og:title, og:image, og:description, and og:url. Its URL troubleshooting guidance says the share box relies on oEmbeds and/or Open Graph Protocol. LinkedIn may fail to fetch an image if access to the site is blocked or the image is in a protected location.
Rank #3
- CUSTOMIZED FOR YOUR BRAND – Personalize your sticker with your Instagram, Facebook, YouTube, or other social media username or logo to help customers easily find and follow your business.
- PREMIUM POLYMERIC VINYL – Made from high-quality outdoor-grade polymeric vinyl that is waterproof, UV-resistant, scratch-resistant, and built to withstand daily wear and harsh weather conditions.
- VERSATILE APPLICATION – Perfect for cars, trucks, laptops, storefront windows, toolboxes, water bottles, trailers, business displays, and other smooth, clean surfaces.
- EASY TO APPLY & REMOVE – Features a strong adhesive for a secure hold while removing cleanly without leaving sticky residue when properly removed from most surfaces.
- PROFESSIONAL BUSINESS PROMOTION – Turn your vehicle or equipment into a mobile advertisement with durable custom social media decals that increase brand visibility and help attract new followers wherever you go.
If you have just changed the page’s preview metadata, LinkedIn advises allowing up to 48 hours for its cache to refresh before checking again. This is operational guidance from LinkedIn, not a guarantee that every preview will update within that period.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to use a multi-network plugin instead
If you want LinkedIn alongside other sharing services, a WordPress sharing plugin may be a better fit than adding LinkedIn’s standalone embed. AddToAny’s WordPress.org listing documents LinkedIn support as well as other networks and describes placement and customization options. Its listing gives these dashboard steps:
Rank #4
- CUSTOMIZED FOR YOUR BRAND – Personalize your sticker with your Instagram, Facebook, YouTube, or other social media username or logo to help customers easily find and follow your business.
- PREMIUM POLYMERIC VINYL – Made from high-quality outdoor-grade polymeric vinyl that is waterproof, UV-resistant, scratch-resistant, and built to withstand daily wear and harsh weather conditions.
- VERSATILE APPLICATION – Perfect for cars, trucks, laptops, storefront windows, toolboxes, water bottles, trailers, business displays, and other smooth, clean surfaces.
- EASY TO APPLY & REMOVE – Features a strong adhesive for a secure hold while removing cleanly without leaving sticky residue when properly removed from most surfaces.
- PROFESSIONAL BUSINESS PROMOTION – Turn your vehicle or equipment into a mobile advertisement with durable custom social media decals that increase brand visibility and help attract new followers wherever you go.
- In WordPress, open Plugins > Add New.
- Search for
addtoany. - Install the plugin, then activate it.
AddToAny is a third-party alternative, not LinkedIn’s official standalone button. Choose based on whether you need one network or several, whether you are comfortable adding PHP or prefer dashboard settings, and where you want the controls to appear. The cited materials do not establish a comparative performance advantage for either approach.
Recommended Free Tools
Quick Recap
Best Value
- Decorate your car, truck, laptop, or window and stand out from the crowd with this holographic WhatsApp icon sticker. Rainbow material changes colors, depth, and variations depending on lighting and angles.
- Icon is cut from weatherproof holographic vinyl. Durable, long lasting material will withstand prolonged use through all the elements. Sticker is car wash safe.
- This set includes one 5 by 5-inch sticker, perfect for advertising your social media presence. Add your own handle or business name; use on company vehicles. Look for our custom social media products for more options.
- Decals come with a layer of transfer tape already applied for easy application. Detailed use and care instructions are included. Use on glass, metal, plastic, etc. Not recommended for painted surfaces.
- All decals are designed and manufactured in the United States.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




