This SharePoint Online tutorial explains how to enable Save site as template option in a publishing site in SharePoint Online Office 365 using PowerShell.
New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features
We have observed save site as template option doesn’t show in publishing sites in SharePoint Online or SharePoint 2013/2016. If you try to navigate to save site template page it will further show you below error message.

Enable Save Site as Template using PowerShell in Publishing Site in SharePoint Online
You can read an article on Save site as a template in SharePoint 2013/2016/Online.
Let’s talk about the solution. We can write CSOM with PowerShell script to enable the site settings. If you are new to PowerShell SharePoint, you can read: Working with PowerShell in SharePoint Online/2016/2013.
Please find below script and execute against site.
cls
$0 = $MyInvocation.MyCommand.Definition
$dp0 = [System.IO.Path]::GetDirectoryName($0)
$username = “sambita@***.com”
$password = “*****”
#$url = $xmldata.WebSite.Url
$url =’https://****.sharepoint.com/sites/test/’
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
# connect/authenticate to SharePoint Online and get ClientContext object..
$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
$clientContext.Credentials = $credentials
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll”
Add-Type -Path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll”
if (!$clientContext.ServerObjectIsNull.Value)
{
Write-Host “Connected to SharePoint Online site: ‘$Url'” -ForegroundColor Green
$web = $clientContext.Web
$clientContext.Load($web)
$web.AllProperties[“SaveSiteAsTemplateEnabled”] = “true”
$web.Update()
$clientContext.ExecuteQuery()
}
You may like following SharePoint tutorials:
- Enable Save site as a template using SharePoint designer in SharePoint 2013
- The Save site as template action is not supported on this site error in SharePoint 2013
- [Solution] Save Site as Template option missing under Site Action Section in the Site Settings menu in SharePoint 2010/2013/2016/Online
- Communication Site Overview in SharePoint Online Office 365
- Working with Sites in SharePoint online office 365 using JavaScript Object Model jsom
- Steps to force delete corrupted site collection using PowerShell in SharePoint 2013
- How to check which site template used in SharePoint Online Site using JSOM (JavaScript Object Model)?
- SharePoint Online Team site Vs Communication site
- SharePoint Create Subsite with Unique Permissions in SharePoint 2013/2016/Online
Hope this will be helpful to enable Save site as Template option in Publishing Site in SharePoint Online Office 365 using PowerShell.