Remove Theme from Site in SharePoint 2013 using PowerShell

Requirement: To enforce consistency, We wanted to reset custom themes applied on SharePoint sites by end-users in our SharePoint environment.

How to remove a theme in SharePoint using PowerShell?

Here is how to remove the theme from SharePoint programmatically using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$WebAppURL = ""

Get-SPWebApplication $WebAppURL | Get-SPSite -Limit ALL | Get-SPWeb | ForEach-Object {
  #remove theme sharepoint 2013
  $Theme = [Microsoft.SharePoint.Utilities.ThmxTheme]::RemoveThemeFromWeb($Web,$false)
Write-host "Themes are removed from all sites!" 

This removes and resets to default SharePoint theme. The same script works for SharePoint 2010 also to remove theme.

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