CreatorSEO Post Embed for LinkedIn
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.
