Microsoft 365 saving a SharePoint site as a template

Saving a SharePoint site as a template in Microsoft 365 allows you to reuse site structures, settings, lists, libraries, and content across your organization, ensuring consistency and saving time. However, this feature is not enabled by default, especially for modern sites, and requires administrator permissions and configuration changes to unlock. The process varies slightly depending on whether you’re working with classic, communication, or modern team sites.

Prerequisites

  • You must have Global Administrator or SharePoint Administrator privileges.
  • Custom scripting must be enabled on the site collection (this may take up to 24 hours to take effect unless PowerShell is used).
  • For modern team sites with Microsoft 365 groups, use PowerShell instead of the classic UI method.
  • Ensure you’re using SharePoint Online Management Shell or PnP PowerShell for script-based approaches.

Step-by-step instructions

Method 1: Using the Classic UI (Classic and Communication Sites)

  1. Enable custom script in the SharePoint Admin Center:
    • Go to SharePoint Admin Center.
    • Click on Settings > Custom Script.
    • Enable both:
      • Allow users to run custom script on personal sites
      • Allow users to run custom script on self-service created sites
    • Click OK (note: changes may take up to 24 hours).
  2. Navigate to your target site (e.g., https://yourdomain.sharepoint.com/sites/yoursite).
  3. Append the following to the URL and press Enter:/_layouts/15/savetmpl.aspxThis will open the “Save Site as Template” page.
  4. Fill in the required fields:
    • File Name: A unique name for the .wsp template file.
    • Template Name: Display name for the template.
    • Description: Optional description.
    • Include Content: Check this box if you want to include existing lists, libraries, and data.
  5. Click OK to save.
  6. The template is now stored in the Solution Gallery of the site collection and can be used when creating new subsites under the Custom tab.

⚠️ If the “Save Site as Template” option doesn’t appear, use PowerShell to enable scripting immediately (see below).

  1. Install SharePoint Online Management Shell (if not already installed).
  2. Open PowerShell as administrator and run:# Connect to SharePoint Admin Center Connect-SPOService -Url https://<your-tenant>-admin.sharepoint.com
  3. Enable custom scripting on the target site (bypass 24-hour delay):Set-SPOSite -Identity https://<your-tenant>.sharepoint.com/sites/yoursite -DenyAddAndCustomizePages $False
  4. For modern team or communication sites, use Get-SPOSiteScriptFromWeb to capture the site structure:$SiteURL = "https://<your-tenant>.sharepoint.com/sites/yoursite" # Extract site schema including branding, pages, and settings $SiteSchema = Get-SPOSiteScriptFromWeb -WebUrl $SiteURL -IncludeBranding -IncludeTheme -IncludeRegionalSettings -IncludeSiteExternalSharingCapability -IncludedLists "SitePages" # Save as a reusable site script $SiteScript = Add-SPOSiteScript -Title "My Site Template" -Description "Template from existing site" -Content $SiteSchema # Create a site design based on the script Add-SPOSiteDesign -Title "My Site Design" -WebTemplate 64 -SiteScripts $SiteScript.Id -Description "Reusable team site design"
  5. The new site design will appear in the Templates section when creating new sites and can be applied organization-wide.

✅ Use this method for modern sites where the classic template option is unavailable.

Posted in public and tagged , , .

Leave a Reply