SharePoint Online: How to Change the Author in Modern Page?

Requirement: Set Author in the header section of the modern SharePoint Online page.

How to change the author in SharePoint Online Modern Pages?

Setting the author field in SharePoint Online modern pages is relatively straightforward. Simply click on the author field and start typing the user name. If there is an existing author set, You can remove it by clicking on the “x” symbol and then entering the new Author.

sharepoint online change page author

PowerShell to Set Author in Modern SharePoint Online Pages

How about changing the Author using PowerShell? Here is the PowerShell to set the Author in the Page Header area.

$SiteURL = ""
$PageName = "Home.aspx"
$AuthorEmail = "[email protected]"

Try {
    #Connect to PnP Online
    Connect-PnPOnline $SiteURL -Interactive

    #Get the Page
    $Page = Get-PnPPage -Identity $PageName

    #Resolve the Author User
    $Author = Get-PnPUser | Where-Object Email -eq $AuthorEmail
    If($Author -eq $null) {        
        $Author = New-PnPUser -LoginName $AuthorEmail

    #Set the Authors and AuthorByLine properties of the PageHeader - in JSON format
    $Page.PageHeader.Authors = "[{`"id`":`"$($Author.LoginName)`"}]"
    $Page.PageHeader.AuthorByLine = "[`"$($Author.Email)`"]"

    #Save the changes and publish the page
    $Page.Save() | Out-Null
Catch {
    write-host -f Red "Error:" $_.Exception.Message

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “SharePoint Online: How to Change the Author in Modern Page?

  • Can the updated AuthorByLine user gets, SP notification emails related to page comments and likes?


Leave a Reply

Your email address will not be published.