SharePoint 2010 - Remove / Disable Themes

If you've ever encountered the need the disable themes on a site collection, there are a few options you may have available.

Firstly, there are policies in Central Administration to remove the ability to change the themes across the entire web application, which can be done by the following:
  1. Visit Central Administration > Application Management > Web Applications > Manage Web Applications.
  2. Select the Web Application that you want to restrict the themes on.
  3. Click on "Permission Policy Level" on the Ribbon.
  4. Name the policy, and find the permission "Apply Themes and Borders" and toggle the "Deny" check box.
  5. Click save.
  6. Click on "User Policy" on the Ribbon.
  7. Add the users and groups you want to restrict, and then apply the policy you just created.

Alternatively, if you want to manually remove the themes, you can update the theme entries, in a file called:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts\1033\SPTHEME.XML

There, you can remove all themes with the exception of default - the sections you would want to delete are the nodes. Noted, I take no responsibility for any issues caused by this method. I would expect you to make a backup of this file.

If you can't do either of the above options, and utilizing a managed environment. You could take a third approach, which involves removing the available themes, resetting your themes to default, and disabling the 'Enhanced Theming' hidden feature. You can remove all the managed themes, via the following code in a site-scoped feature receiver, on feature activation.

if (properties != null)
{
     using (SPSite _SPSite = properties.Feature.Parent as SPSite)
     {
         using (SPWeb web = _SPSite.RootWeb)
         {
             ReadOnlyCollection ManagedThemes = null;
             ManagedThemes = ThmxTheme.GetManagedThemes(web.Site);
             SPFile file = null;
             foreach (ThmxTheme themes in ManagedThemes)
             {
                 file = web.GetFile(themes.ServerRelativeUrl);
                 file.Delete();
             }
         }
     }
 }
and then also disabled the following feature through feature stapling,

'Enhanced Theming' - GUID: 068bc832-4951-11dc-8314-0800200c9a66
Also, to reset your theme, in some site scoped feature stapler, you could also reset the theme to default.
ThmxTheme.RemoveThemeFromWeb(_SPWeb, false);

Comments