Change Published Date for News Post

Iron Contributor

We are converting some old announcements to News Posts and need to ensure that the Published Date is the same as what they were before.

 

We can use PowerShell to change the First Published Date which is used to order the posts in a News Webpart, but the date that is shown at the top of the News Post itself uses another internal/hidden field called Published Date (or something like that). We can't find a way to change this. So the First Published Date is fine, but can't get it to show that date on the actual News Post.

 

Any ideas more than welcome.

 

gjen020_0-1664501655617.png

 

8 Replies

@gjen020 Are you talking about Publish Start Date?

 

You can add publish start date column to library view and then user below JSON formatting code on this column to edit date: 

 

{
  "elmType": "div",
  "inlineEditField": "@currentField",
  "txtContent": "@currentField"
}

 

ganeshsanap_0-1664522704312.png


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Hi,

No this is not what I'm talking about. I'm talking about what's displayed on the actual News Post beneath the title as per the image - not what you can see in the list view.

There are two dates that drive a News Post - Publish Start Date (FirstPublishedDate) is set when you first publish the News Post, but the actual Published Date (Hidden field) is generated each time you publish the News Post. I want that to be changed to an older date (the date of the old announcements I'm converting to a News Post).

Have another look at the image I put in my first post and you'll see what I mean.

 

@gjen020 As per the post - EDIT ORIGINAL PUBLISHING DATE IN SHAREPOINT NEWS POSTS:

 

Unfortunately, I have not found a way to update or replace the Publishing Date value with the First Publishing Date. For some reason this value cannot be updated and SystemUpdate also doesn’t work. While looking for the solution I think I read that it can be done using ShareGate, but I haven’t tried it.

 

Also check below thread using C# to update published date which might help you: How to display published date column in document library 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

I just ran into this same problem. I had a large news post from a couple of years ago. I created a copy of it because I wanted to send out a reminder email about one piece of it. I edited the new post by deleting the content I didn't need anymore. Then published it as a new news post. However, the first published date is still showing the old date so the news post isn't showing up on the Hub or Team site unless I scroll all the way back to the original year source article was posted.
Update! Just found this post.
https://babakdanyal.com/edit-original-publishing-date-in-sharepoint-news-posts/

#start region
#
# Editable Published Date OR First Published Date - Use this script to update the original published date of news articles in the SharePoint site.
#
#end region
$SiteURL = "<site url goes here>"
$ListName= "Site Pages"
$Date = "2019-12-20"
$NewsID = 10
Connect-PnPOnline -Url $SiteURL -Interactive

if (-not (Get-PnPContext)) {
Write-Host "Error connecting to SharePoint Online, unable to establish context" -foregroundcolor black -backgroundcolor Red
return
}
else{
Set-PnPListItem -List $ListName -Identity $NewsID -Values @{"FirstPublishedDate"=$Date;} -UpdateType SystemUpdate
}
We have to do all this to enable what every. other. blog platform already does out of the box?
Yep. :)
This. All day long with everything SharePoint. Starting to think that managing hundreds of employee logins for a WordPress install would have been easier.