WordPress plugin bug fix
Bug Fix: WP LinkedIn Auto Publish Re-Shares Posts on Every Edit
A WP LinkedIn Auto Publish bug can re-share already-published posts on every edit. The fix is an old-status guard around the publish trigger.

The symptom is repeated LinkedIn sharing after normal edits
WP LinkedIn Auto Publish should share a post when it is first published. In this bug, editing an already-published post can trigger another LinkedIn share as if the post were new.
That means a typo fix, link update, SEO title tweak, or added paragraph can become an unintended social post. The cause is small, but the audience impact is visible.
This matters when:
- published posts are being re-shared on LinkedIn after routine edits
- editors need to update live content without creating social noise
- developers need a clear condition to test before applying a temporary PHP fix
The bug is a publish-status check without the old-status guard
The plugin checks the new post status, but the safe decision also needs to know whether the post was already published.
Current trigger
The buggy condition is if ( ‘publish’ === $new_status ) {. It fires whenever the new status is publish.
Missing guard
The condition does not check $old_status, so an update to an existing published post can look like a first publish event.
Safer condition
The fixed condition is if ( ‘publish’ === $new_status && ‘publish’ !== $old_status ) {. That limits the share to a transition into publish.
The risk is not only technical
Repeated LinkedIn posts can make normal editorial maintenance look like spam to followers.
The manual fix is also not risk-free: direct plugin edits can be overwritten by plugin updates, so the decision depends on comfort with PHP and the urgency of the problem.
Before choosing a fix, keep these risks visible:
- Every small edit can trigger another LinkedIn share while the bug is active.
- Audience trust can suffer if the same article is pushed repeatedly.
- Editing plugin PHP directly requires care and a backup.
- A plugin update can overwrite a manual one-line change.
- The safest long-term result is an official plugin update from the developer.
How the one-line fix works
The fix adds one extra condition: only share when a post moves into publish, not when it was already published.
- Find: if ( ‘publish’ === $new_status ) {
- Replace: if ( ‘publish’ === $new_status && ‘publish’ !== $old_status ) {
- Why: The added old-status check separates first publication from later edits.
- Where: The original note found the condition in wp-linkedin-auto-publish.php around line 679.
- Caution: Manual plugin edits should be treated as temporary unless handled through a safer patch or official update.
The important idea is the transition: share when a post becomes published, not whenever a saved post still has published status.
What to do if you are affected now
The right action depends on who maintains the site and how urgent the LinkedIn re-share problem is.
If you are comfortable with PHP
- Back up the site or plugin file before editing.
- Change the publish-status condition to include the old-status guard.
- Test with a draft-to-publish transition and then a normal edit to an already-published post.
If you are not comfortable editing PHP
- Avoid nonessential edits to published posts while the bug is active.
- Ask a developer to apply and test the temporary fix.
- Watch for an official plugin update that includes the corrected condition.
How to verify the behavior
A good test should prove both sides: first publish still shares, later edit does not re-share.
- Create or use a test post instead of a live customer-facing article.
- Publish the draft and confirm the initial LinkedIn share behavior is expected.
- Edit the already-published post and save it again.
- Confirm the edit does not create a duplicate LinkedIn post.
- Check the plugin after future updates because manual changes can be overwritten.
- The fix was reported to the plugin developer through the WordPress.org support forums.
The test passes only when first publication can still share while later edits stay quiet.
Frequently asked questions
Why does WP LinkedIn Auto Publish re-share edited posts?
The bug comes from checking only whether the new post status is publish. Without checking the old status, edits to already-published posts can trigger the same share logic.
What is the one-line fix?
Add an old-status guard: if ( ‘publish’ === $new_status && ‘publish’ !== $old_status ) {.
Will a manual plugin edit survive updates?
Usually no. Direct edits to plugin files can be overwritten when the plugin updates, so treat the manual change as temporary unless it is handled through an update-safe approach.
Choose the safest next action for the site
The fix is small, but the operational choice matters because it touches social publishing and plugin code.
- Confirm that repeated LinkedIn posts happen after editing an already-published post.
- If the site needs an immediate fix, apply the old-status condition carefully and test it.
- If the site can wait, avoid unnecessary edits and watch for the official plugin update.
- After any plugin update, retest the edit workflow so the duplicate-share bug does not return.
The bottom line: this is a known one-line trigger bug. The safest behavior is to share only when a post transitions into published status, not every time a published post is saved.