Update the publishing date of a SharePoint news post

SharePoint adds a date for the first publication when a SharePoint news item is published.

Publishing date in Site Pages library
Publishing date in Site Pages library

The date can also be visible in the post.

Screenshot

The news posts are sorted by publishing date.
If my post “News 1” is updated, the post remains in last place. Employees cannot be informed about the update.

Updated news post
Updated news post

People with permissions can change the publishing date via PnP PowerShell. Members with write permissions belong to the authorized accounts and can update the post themselves (without the support of a SharePoint administrator).

The FirstPublishedDate value must be updated for the post. You need the item ID of the post. You can display the item ID in the view of the site pages.

In my example, I update the publishing date with the date/time of the last modification. If you only update the date, the system will insert 00:00:00 as the time. The time affects the information about “xx minutes ago.”

PowerShell
$ItemID = <ItemID>
$SiteUrl = <SiteURL>

Import-Module PnP.PowerShell
Connect-PnPOnline -Url $SiteUrl -Interactive
$SitePagesLibrary = Get-PnPList | ?{$_.ListItemEntityTypeFullName -eq "SP.Data.SitePagesItem" }
$ListItem = Get-PnPListItem -List $SitePagesLibrary -Id $ItemID
Set-PnPListItem -List $SitePagesLibrary -Identity $ListItem.Id -Values @{ "FirstPublishedDate" = $ListItem.FieldValues.Last_x0020_Modified } -UpdateType SystemUpdate | out-null


A check confirms that the updated post is displayed at the top again.

Updated news post
Updated news post
Share
Avatar photo

Tobias Asböck

Tobias is a Senior System Engineer with around ten years of professional experience with Microsoft 365 products such as SharePoint Online, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. Tobias is a PowerShell Scripter with certifications for Microsoft 365 products. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *