Enable save site as template is blocked by default in SharePoint Online. This may because of multiple reasons-
#Config Parameters
#Get Credentials to connect
#Connect to SharePoint Online Tenant Admin
- Scripting is disabled by default so Enabling scripting will enable that option also.
- If Scripting is enabled then 'Publishing Feature' should be checked. If publishing feature is enabled then 'Save site as template' will be not available
We can enable Scripting by web admin as well as by PowerShell. Enabling by web admin will take upto 24 hour to enable but by powershell we can do that immediately.
#Config Parameters
$AdminSiteURL="https://xxxxxx-admin.onmicrosoft.com"
$SiteURL="https://xxxxxx.onmicrosoft.com"
#Get Credentials to connect
$Cred = Get-Credential
Connect-SPOService -URL $AdminSiteURL -Credential $Cred#Disable DenyAddAndCustomizePages Flag
Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False