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

Hiding the default themes in SharePoint Online is a relatively simple process through PowerShell. 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

PnP PowerShell to Hide Default Themes in SharePoint Online

In SharePoint Online, the default themes can’t be deleted. However, these themes can be hidden from view! Let me show you how to hide default themes in SharePoint Online using PnP PowerShell.

#Config Variables
$AdminSiteURL = "https://crescent-admin.sharepoint.com"

#Connect to Admin Center
Connect-PnPOnline -Url $AdminSiteURL -Interactive

#Hide Default Themes
Set-PnPHideDefaultThemes -HideDefaultThemes $True

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *