INTRANETS
SharePoint: Change the original First Published Date of a News Post
Sometimes you will need to be able to modify the FirstPublishedDate field in SharePoint Site Pages – this is how you do it.
SharePoint: Update original First Published Date of a News Post
The FirstPublishedDate field is a hidden field in SharePoint and difficult to modify.
I recently needed to update a handful of SharePoint News Posts. The News Posts had been created by copying existing posts and had kept the original FirstPublishedDate, which meant that the posts were being displayed in order based on the original date.
Here’s a script you can modify and use in order to modify the FirstPublishedDate field on those posts.
#This script modifies the FirstPublishedDate for a single item in the News-SitePages library.
#Update the script with your SharePoint $ClientID and SharePoint site URL, removing the < >
# Connect to the SharePoint site
$ClientId = "<enter your SharePoint $ClientID>"
$SPRootSite = "<enter your SharePoint site URL>"
Connect-PnPOnline -Url $SPRootSite -ClientId $ClientId -Interactive# Prompt the user to enter the ID number of the news item to update
$newsItemId = Read-Host -Prompt "News item ID?"# Prompt the user to enter the new publish date
$newpublishDate = Read-Host -Prompt "New publish date? (YYYY-MM-DD)"# Get the news item
$NewsItem = Get-PnPListItem -List 'SitePages' -Id $newsItemId# Update the news item with the new publish date
Set-PnPListItem -List 'SitePages' -Identity $newsItemId -Values @{'FirstPublishedDate' = $newpublishDate } -UpdateType SystemUpdate


Campbell Smythe
Author
I am an intranet specialist working in SharePoint and other Microsoft 365 technologies.
Recent articles

SharePoint: Using Microsoft Stock images in SharePoint intranets
Are there any attribution requirements to using Microsoft’s Stock Images found in SharePoint Modern? This is what I learned when wanting to stay in line with copyright requirements…

SharePoint: Convert Pages to News Posts and News Posts to Pages
I needed a solution which would make it easy for our intranet team to make changes to the Promoted State of Pages and News Posts in SharePoint SitePages.

SharePoint: Show content owners page published status easily
We have found it useful for page owners to easily see the published status of their pages. Learn how to easily format the column using JSON code.