Description
CreatorSEO Post Embed for LinkedIn provides a simple way to add one or more LinkedIn post embeds to a WordPress post or page.
The plugin does not scrape LinkedIn and does not rely on an unofficial LinkedIn feed. Instead, it uses LinkedIn post references supplied by the editor.
Editors can paste:
- A copied LinkedIn post link
- A LinkedIn URN
- A LinkedIn embed URL
- A full LinkedIn iframe embed code
The plugin extracts the valid LinkedIn URN and stores it against the current post or page. The saved embeds can then be displayed using a shortcode.
Supported URN formats include:
- urn:li:share:123456789
- urn:li:activity:123456789
- urn:li:ugcPost:123456789
Copied LinkedIn post links are also supported when the URL contains a LinkedIn post identifier such as:
- share-123456789
- activity-123456789
- ugcPost-123456789
The plugin extracts the numeric post identifier and converts it into a validated LinkedIn URN.
Important note: not every LinkedIn post can be embedded. The most reliable approach is to use posts where LinkedIn itself provides the “Embed this post” option.
This plugin is an independent WordPress plugin and is not affiliated with, endorsed by, sponsored by, or otherwise associated with LinkedIn Corporation or its affiliates. The plugin does not modify LinkedIn, change LinkedIn’s behaviour, or provide access to LinkedIn services beyond displaying individual posts through LinkedIn’s own publicly available embed functionality. LinkedIn is a trademark of LinkedIn Corporation.
External Services
This plugin does not use the LinkedIn API, make server-to-server requests to LinkedIn, or transmit WordPress user information to any external service.
When a LinkedIn post is displayed, the plugin generates an iframe that loads the embedded post directly from LinkedIn. The visitor’s browser therefore connects directly to LinkedIn and may transmit information normally included with a web request, such as the visitor’s IP address, browser information, cookies, and the referring page.
The plugin does not collect, store, process, or transmit this information itself. The loading and operation of the embedded content are controlled by LinkedIn and are subject to LinkedIn’s terms and privacy policies.
LinkedIn User Agreement:
https://www.linkedin.com/legal/user-agreement
LinkedIn Privacy Policy:
https://www.linkedin.com/legal/privacy-policy
LinkedIn Cookie Policy:
https://www.linkedin.com/legal/cookie-policy
Main Features
- Add multiple LinkedIn embeds to a post or page
- Store only validated LinkedIn URNs
- Supports copied LinkedIn post links containing share, activity, or ugcPost identifiers
- Supports LinkedIn URNs, embed URLs, and iframe embed code
- AJAX add and remove interface in the WordPress editor
- Front-end add popup for logged-in users who can edit the current post or page
- Dashboard interface for removing saved embeds
- Shortcode output for saved embeds
- Gallery and list layout options
- Responsive gallery layout with two columns on desktop and one column on smaller screens
- Shortcode option to limit the number of displayed embeds
- Option to display the most recently added embeds first
- Global settings for default width, height, layout, maximum embeds, and the front-end add button
- Shortcode attributes can override the global settings
Usage
-
Open a post or page in the WordPress editor.
-
Find the “LinkedIn Post Embed” meta box.
-
Paste one of the following input types.
LinkedIn URN:
urn:li:ugcPost:7351599493286436865
LinkedIn embed URL:
https://www.linkedin.com/embed/feed/update/urn:li:ugcPost:7351599493286436865
LinkedIn iframe embed code:
Copied LinkedIn post link containing a share identifier:
https://www.linkedin.com/posts/example-share-7480973147496914944-kWYz/
Copied LinkedIn post link containing a ugcPost identifier:
https://www.linkedin.com/posts/example-ugcPost-7480592425179299841-2yVZ/
-
Click “Add LinkedIn Embed”.
-
Add the shortcode to the post or page content:
[li2p_linkedin_embed]
-
View the post or page on the front end.
Front-End Add Button
When enabled, logged-in users who can edit the current post or page will see an “Add LinkedIn Embed” button above the displayed embeds.
Clicking the button opens a popup where the user can paste:
- A copied LinkedIn post link
- A LinkedIn URN
- A LinkedIn embed URL
- A full LinkedIn iframe embed code
The plugin validates the input, extracts and stores the LinkedIn URN, and reloads the page so the new embed appears.
The front-end feature supports adding embeds only. Saved embeds are removed from the WordPress dashboard editor using the “LinkedIn Post Embed” meta box.
Permission is checked using:
current_user_can( ‘edit_post’, $post_id )
Access is therefore based on whether the user can edit the specific post or page, rather than only on the user’s role name.
Shortcode
Basic shortcode:
[li2p_linkedin_embed]
Display only the first four saved embeds:
[li2p_linkedin_embed max=”4″]
Display the most recently added embeds first:
[li2p_linkedin_embed latest=”1″]
Display embeds in the original saved order:
[li2p_linkedin_embed latest=”0″]
Use the gallery layout:
[li2p_linkedin_embed layout=”gallery”]
Use the list layout:
[li2p_linkedin_embed layout=”list”]
Set a custom iframe height:
[li2p_linkedin_embed height=”856″]
Set a custom iframe width and height:
[li2p_linkedin_embed width=”504″ height=”856″]
Disable LinkedIn collapsed mode:
[li2p_linkedin_embed collapsed=”0″]
Hide the front-end add button:
[li2p_linkedin_embed frontend_add=”0″]
Display embeds saved against a specific post or page:
[li2p_linkedin_embed post_id=”123″]
Shortcode Attributes
post_id
Optional.
The post or page ID from which to load saved LinkedIn embeds.
Default:
The current post or page ID.
collapsed
Optional.
Controls whether LinkedIn collapsed embed mode is enabled.
Values:
1 = Collapsed mode enabled
0 = Collapsed mode disabled
Default:
1
width
Optional.
The iframe width in pixels.
Default:
Controlled by the plugin settings.
height
Optional.
The iframe height in pixels.
Default:
Controlled by the plugin settings.
LinkedIn embeds are loaded from a different domain. WordPress cannot automatically inspect the content inside the LinkedIn iframe to determine its required height. A suitable iframe height must therefore be configured.
max
Optional.
The maximum number of saved embeds to display.
Values:
0 = Display all saved embeds
Any positive number = Limit the output to that number
Default:
Controlled by the plugin settings.
latest
Optional.
Controls whether the most recently added embeds are displayed first.
Values:
1 = Display the most recently added embeds first
0 = Display embeds in their original saved order
Default:
Controlled by the Display Latest toggle on the plugin settings page.
Note:
The plugin uses the order in which embeds were added to WordPress. It does not check the original LinkedIn.
layout
Optional.
Controls the layout used to display the embeds.
Values:
gallery = Two-column gallery on desktop and one column on smaller screens
list = One centred LinkedIn post per row
Default:
Controlled by the Gallery Layout toggle on the plugin settings page.
frontend_add
Optional.
Controls whether the front-end add button is shown to logged-in users who can edit the current post or page.
Values:
1 = Show the button when the user has edit permission
0 = Hide the button
Default:
Controlled by the plugin settings.
Plugin Settings
The plugin settings page is available under:
Tools LinkedIn to Post
Available settings include:
Gallery Layout
When enabled, embeds are displayed in a responsive gallery with two columns on desktop and one column on smaller screens.
When disabled, embeds are displayed in a single-column list.
The layout can be overridden using the shortcode layout attribute.
Allow Front-End Adding
Controls whether logged-in users with permission to edit the current post or page can add LinkedIn embeds from the front end.
Default Embed Width
Sets the default iframe width used by the shortcode unless it is overridden using the width attribute.
Default Embed Height
Sets the default iframe height used by the shortcode unless it is overridden using the height attribute.
Maximum Embeds
Sets the default maximum number of embeds displayed by the shortcode.
Use 0 to display all saved embeds.
Display Latest
Controls whether the most recently added embeds are displayed first by default.
When enabled, the shortcode displays the newest saved embeds first. When disabled, embeds are displayed in their original saved order.
This can be overridden using the latest shortcode attribute.
Layouts
The plugin provides two layout options.
Gallery Layout
The gallery layout displays two LinkedIn posts per row on larger screens.
On screens below the responsive breakpoint, the gallery changes to a single-column layout.
Example:
[li2p_linkedin_embed layout=”gallery”]
List Layout
The list layout displays one centred LinkedIn post per row.
Example:
[li2p_linkedin_embed layout=”list”]
LinkedIn embeds use a configured iframe height. Because the iframe content is hosted by LinkedIn, WordPress cannot automatically detect the internal height of each post.
The gallery is therefore designed as a clean and consistent grid rather than a variable-height masonry layout.
Dashboard Editing
The WordPress editor includes a “LinkedIn Post Embed” meta box for supported posts and pages.
From this meta box, editors can:
- Paste a copied LinkedIn post link, LinkedIn URN, embed URL, or iframe embed code
- Add a validated LinkedIn embed using AJAX
- View the saved URNs for the current post or page
- Remove saved embeds from the current post or page
Removing embeds is available from the WordPress dashboard editor.
Embeds are stored in the order they are added. The display order can be changed using the Display Latest setting or the latest shortcode attribute.
Front-end editing currently supports adding embeds only.
Notes About LinkedIn Embeds
LinkedIn does not provide a normal public RSS feed for company page posts.
LinkedIn company post listing pages should not be embedded directly in an iframe.
For example, this is not reliable:
The plugin is designed to work with individual LinkedIn posts that LinkedIn permits to be embedded.
The most reliable method is:
- Open the individual LinkedIn post.
- Open the post menu.
- Choose “Embed this post”, if available.
- Copy the iframe embed code.
- Paste the code into the plugin.
Alternatively, use LinkedIn’s “Copy link to post” option and paste the copied URL into the plugin.
If LinkedIn does not provide an embed option for a specific post, that post may not be embeddable.
Stored Data
The plugin stores validated LinkedIn URNs in post meta.
Meta key:
_li2p_linkedin_embeds
Stored format:
array(
‘urn:li:ugcPost:7351599493286436865’,
‘urn:li:activity:7478345519078158336’
)
The plugin does not store the full iframe embed code.
Security
The plugin validates LinkedIn URNs before storing them.
Only supported URN formats are accepted:
urn:li:share:123456789
urn:li:activity:123456789
urn:li:ugcPost:123456789
Submitted values are unslashed, sanitised, validated, and converted into supported LinkedIn URNs before storage.
AJAX requests are protected using WordPress nonces.
Front-end add functionality is only available to users who can edit the current post or page.
Saved embeds can only be removed from the WordPress dashboard editor.
Output values and HTML attributes are escaped before being displayed.
Screenshots






Installation
Upload the plugin folder to: wp-content/plugins/creatorseo-post-embed-for-linkedin/
Activate the plugin from: Plugins CreatorSEO Post Embed for LinkedIn Activate
Open the plugin settings page: Tools LinkedIn to Post
Open a post or page in the WordPress editor.
Use the “LinkedIn Post Embed” meta box to add LinkedIn embeds.
Add the following shortcode to the post or page content: [li2p_linkedin_embed]
FAQ
-
Does this plugin automatically find the latest LinkedIn company post?
-
No. LinkedIn does not provide a simple public RSS feed or reliable public endpoint for company posts.
The plugin avoids scraping and uses LinkedIn post references supplied by an editor.
-
Can I paste a copied LinkedIn post link?
-
Yes.
Copied LinkedIn post links are supported when the URL contains a LinkedIn post identifier such as:
- share-123456789
- activity-123456789
- ugcPost-123456789
The plugin extracts the numeric identifier and converts it into a validated LinkedIn URN.
-
Can I paste the full LinkedIn iframe embed code?
-
Yes.
The plugin extracts the LinkedIn URN from the iframe embed code and stores only the validated URN.
-
Can I add multiple LinkedIn embeds to one post or page?
-
Yes.
Multiple embeds can be saved and displayed using the shortcode.
-
Can I add embeds from the front end?
-
Yes.
When the feature is enabled, logged-in users who can edit the current post or page can add embeds using the front-end Add LinkedIn Embed popup.
-
Can I remove embeds from the front end?
-
No.
Front-end editing currently supports adding embeds only. Saved embeds can be removed from the WordPress dashboard editor.
-
Can I limit how many embeds are displayed?
-
Yes.
Use the max attribute.
Example:
[li2p_linkedin_embed max=”3″]
-
Can I display the newest embeds first?
-
Yes.
Use the latest attribute.
Example:
[li2p_linkedin_embed latest=”1″]
Use latest=”0″ to display embeds in their original saved order.
The plugin uses the order in which embeds were added to WordPress. It does not check the original LinkedIn publishing date.
-
Can I change the layout?
-
Yes.
The shortcode supports gallery and list layouts.
Gallery layout:
[li2p_linkedin_embed layout=”gallery”]
List layout:
[li2p_linkedin_embed layout=”list”]
The default layout is controlled by the Gallery Layout toggle on the plugin settings page.
-
What is the difference between the gallery and list layouts?
-
The gallery layout displays two posts per row on larger screens and one post per row on smaller screens.
The list layout always displays one centred post per row.
-
Why is the gallery not a masonry layout?
-
LinkedIn posts are displayed inside fixed-height, cross-origin iframes.
WordPress cannot inspect the content inside a LinkedIn iframe to automatically determine the height of each embedded post. A consistent grid layout is therefore more reliable than a variable-height masonry layout.
-
Can the iframe height be detected automatically?
-
No.
The LinkedIn embed is hosted on linkedin.com. Browser same-origin security prevents the WordPress page from directly measuring the content inside the iframe.
The default iframe height can be configured on the plugin settings page or overridden using the shortcode height attribute.
-
Why does a LinkedIn post show “Page not found” inside the iframe?
-
This usually means that the post is not embeddable or that the wrong URN type was used.
The safest method is to use LinkedIn’s own “Embed this post” option when it is available.
-
Does this plugin scrape LinkedIn?
-
No.
The plugin does not scrape LinkedIn.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“CreatorSEO Post Embed for LinkedIn” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “CreatorSEO Post Embed for LinkedIn” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.04
Display order update.
- Added a Display Latest setting to show the most recently added embeds first
- Added the latest shortcode attribute
- Updated shortcode documentation to explain saved order and latest-first display
1.03
Layout and validation update.
- Replaced the previous masonry and flex layout options with gallery and list layouts
- Added a Gallery Layout toggle to the plugin settings page
- Gallery mode displays two columns on desktop and one column on smaller screens
- List mode displays one centred LinkedIn post per row
- Added the layout shortcode attribute with gallery and list values
- Added shortcode examples for both layout options
- Removed obsolete masonry-specific iframe wrapper handling
- Updated submitted front-end values to be unslashed and sanitised before validation
- Updated plugin documentation to explain fixed LinkedIn iframe heights
- Updated plugin documentation and terminology throughout
1.02
Copied LinkedIn post link support.
- Added support for copied LinkedIn post links containing share, activity, or ugcPost identifiers
- Copied LinkedIn post links are converted into validated LinkedIn URNs before saving
- Updated plugin documentation to include copied LinkedIn post link examples
1.01
Initial working release.
Features included:
- Multiple LinkedIn embed support
- Validated URN storage
- Admin AJAX add and remove interface
- Front-end add popup for logged-in editors
- Dashboard-only removal of saved embeds
- Shortcode output
- Initial masonry and flex layout options
- Shortcode maximum embed option
- Plugin settings page under Tools
- Default width, height, layout, maximum embeds, and front-end add options
