SharePoint Online: How to Hide Default Themes?

Themes are quick ways to add branding to SharePoint Online sites. However, we wanted to restrict site owners from changing the themes for a uniform look and feel overall sites. Fortunately, SharePoint Online provides a cmdlet to hide default themes and enforce governance.

PowerShell to Hide Default Themes in SharePoint Online

Open SharePoint Online Management Shell, and run this PowerShell script to hide default themes in SharePoint Online:

#SharePoint Online Admin Center URL
$AdminURL = "https://crescent-admin.sharepoint.com/"

#Get Credentials to connect
$Cred = Get-Credential

#Connect to SharePoint Online
Connect-SPOService -url $AdminURL -credential $Cred

#Check If Default Themes are hidden already
If(Get-SPOHideDefaultThemes) 
{
    Write-Host -f Yellow "Default themes are already hidden!"
}
Else
{
    Set-SPOHideDefaultThemes $True
    Write-Host -f Yellow "Default themes are now hidden!"
}

Now, this is what you get when you click on “Change the Look” from the Site Settings menu in modern SharePoint Online sites:

To reverse (Enable all default themes), simply call the “Set-SPOHideDefaultThemes” cmdlet with the “$False” parameter.

Set-SPOHideDefaultThemes $False

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply