Skip to content

spo page set

Updates modern page properties


spo page set [options]


Option Description
--help output usage information
-n, --name <name> Name of the page to update
-u, --webUrl <webUrl> URL of the site where the page to update is located
-l, --layoutType [layoutType] Layout of the page. Allowed values Article,Home
-p, --promoteAs [promoteAs] Update the page purpose. Allowed values HomePage,NewsPage
--commentsEnabled [commentsEnabled] Set to true, to enable comments on the page. Allowed values true,false
--publish Set to publish the page
--publishMessage [publishMessage] Message to set when publishing the page
--query [query] JMESPath query string. See for more information and examples
-o, --output [output] Output type. json,text. Default text
--pretty Prettifies json output
--verbose Runs command with verbose logging
--debug Runs command with debug logging


If you try to create a page with a name of a page that already exists, you will get a The file doesn't exists error.

If you choose to promote the page using the promoteAs option or enable page comments, you will see the result only after publishing the page.


Change the layout of the existing page to Article

spo page set --name page.aspx --webUrl --layoutType Article

Promote the existing article page as a news article

spo page set --name page.aspx --webUrl --promoteAs NewsPage

Promote the existing article page as a template

spo page set --name page.aspx --webUrl --promoteAs Template

Change the page's layout to Home and set it as the site's home page

spo page set --name page.aspx --webUrl --layoutType Home --promoteAs HomePage

Enable comments on the existing page

spo page set --name page.aspx --webUrl --commentsEnabled true

Publish existing page

spo page set --name page.aspx --webUrl --publish