A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
This is what I use-save this as a ps1 file like "update.ps1":
#Parameters & formats # $_AuthorByline = iNumber@xxx or name,$FirstPublishedDate = "2019-11-27T10:30:00-00:00" ,$Modified = "2019-11-27T10:30:00-00:00"
$SiteURL= "https://xxx.sharepoint.com/sites/yoursitename"
$ListName = "SitePages"
$ItemID = "413"
$FirstPublishedDate = "2023-12-28T12:00:00-00:00"
#Connect to PnP Online Connect-PnPOnline -Url
$SiteURL -UseWebLogin Set-PnPListItem -List
$ListName -Identity
$ItemID -Values @{"FirstPublishedDate"=$FirstPublishedDate}
Then open the Sharepoint management shell (download it if you don't have it). Navigate to the directory you saved the ps1 file in and enter:
.\update.ps1 (change file name obviously to whatever you saved the file as)
You'll probably get a prompt to log in as a site admin (r maybe even a SP admin)
If you get an error about commands not existing you need to install the PnP library-read about it here: https://www.sharepointdiary.com/2021/02/how-to-install-pnp-powershell-module-for-sharepoint-online.html
This way the next time it happens (and it will) you can just change the site url, page id and date in the file and run it again. We also use this to update other read only fields, like created date, created by (which is default author) Etc.