Skip to main content

spo page set

Updates modern page properties

Usage

m365 spo page set [options]

Options

-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, SingleWebPartAppPage, RepostPage, HeaderlessSearchResults, Spaces, Topic.

-p, --promoteAs [promoteAs]

Update the page purpose. Allowed values HomePage, NewsPage, Template.

--demoteFrom [demoteFrom]

Update the page purpose back to a regular article. Allowed values 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.

--description [description]

The description to set for the page.

--title [title]

The title to set for the page.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

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.

Examples

Change the layout of the existing page to Article

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --layoutType Article

Promote the existing article page as a news article

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --promoteAs NewsPage

Promote the existing article page as a template

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --promoteAs Template

Demote the existing newspage

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --demoteFrom NewsPage

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

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --layoutType Home --promoteAs HomePage

Enable comments on the existing page

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --commentsEnabled true

Publish existing page

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --publish

Set page description

m365 spo page set --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --description "Description to add for the page"

Response

The command won't return a response on success.

CTRL + M