Skip to content

spo page copy

Creates a copy of a modern page or template


m365 spo page copy [options]


--sourceName <sourceName>
The name of the source file
--targetUrl <targetUrl>
The URL of the target file. You can specify page's name or relative- or absolute URL
Overwrite the target page when it already exists
-u, --webUrl <webUrl>
URL of the site where the page to retrieve is located
-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 for more information and examples
-o, --output [output]
Output type. json,text,csv. Default json
Runs command with verbose logging
Runs command with debug logging


If another page exists at the specified target location, copying the page will fail, unless you include the --overwrite option.


Create a copy of the home.aspx page

m365 spo page copy --webUrl --sourceName "home.aspx" --targetUrl "home-copy.aspx"

Overwrite the target page if it already exists

m365 spo page copy --webUrl --sourceName "home.aspx" --targetUrl "home-copy.aspx" --overwrite

Create a copy of a page template

m365 spo page copy --webUrl --sourceName "templates/PageTemplate.aspx" --targetUrl "page.aspx"

Copy the page to another site

m365 spo page copy --webUrl --sourceName "templates/PageTemplate.aspx" --targetUrl ""