Skip to content

spo web add

Create new subsite

Usage

spo web add [options]

Options

Option Description
--help output usage information
-t, --title <title> Subsite title
-d, --description [description] Subsite description
-u, --webUrl <webUrl> Subsite relative url
-w, --webTemplate <webTemplate> Subsite template, eg. STS#0 (Classic team site)
-p, --parentWebUrl <parentWebUrl> URL of the parent site under which to create the subsite
-l, --locale [locale] Subsite locale LCID, eg. 1033 for en-US. Default 1033
--breakInheritance Set to not inherit permissions from the parent site
--inheritNavigation Set to inherit the navigation from the parent site
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Important

Before using this command, log in to a SharePoint Online site, using the spo login command.

Remarks

To create a subsite, you have to first log in to a SharePoint site using the spo login command, eg. spo login https://contoso.sharepoint.com.

Examples

Create subsite using the Team site template in the en-US locale

spo web add --title Subsite --description Subsite --webUrl subsite --webTemplate STS#0 --parentWebUrl https://contoso.sharepoint.com --locale 1033

Create subsite with unique permissions using the default en-US locale

spo web add --title Subsite --webUrl subsite --webTemplate STS#0 --parentWebUrl https://contoso.sharepoint.com --breakInheritance

Create subsite with the same navigation as the parent site

spo web add --title Subsite --webUrl subsite --webTemplate STS#0 --parentWebUrl https://contoso.sharepoint.com --inheritNavigation