Skip to main content

Theme not fully removed from SharePoint Site Collection

BindTuning Team avatar
Written by BindTuning Team
Updated over 2 months ago

You've deleted an SPFx theme package from your SharePoint App Catalog, expecting it to be completely removed from your site collection. However, you might find that the theme, or remnants of its styling, still appear on your site. This is a known issue, and indicates that an additional step is required for a clean removal.


The symptom

  • Even after deleting the theme's SPFx package from the SharePoint App Catalog, the theme's styling or components continue to load on your site collection.

  • The site might display visual errors or unexpected layouts due to missing theme files but an active reference.


Explanation: Why deleting the SPFx package isn't enough

When an SPFx-based theme is installed, it typically involves two main components that need to be removed for a complete uninstallation:

  1. The SPFx Package (.sppkg): This package, stored in your SharePoint App Catalog, contains the core files and assets for the theme. Deleting this removes the theme's central files.

  2. A SharePoint Custom Action (or Application Customizer): This is a small configuration or piece of code deployed directly to your site collection(s). Its purpose is to tell SharePoint which theme to load and apply to that specific site.

If you only delete the SPFx package from the App Catalog, you remove the theme's files, but the Custom Action on your site collection remains active. This custom action will continue to attempt to load the now-missing theme files, leading to the symptoms described above. For a complete removal, this custom action must also be deactivated on the relevant site.


The solution: Deactivating the Theme custom action

Prerequisites

To follow this solution, you will need:

  • The Theme Management Script: This is the PowerShell script originally used to install or manage your BindTuning theme. If you no longer have it, you can typically re-download the theme's installation package from your Created By Me themes catalog.

  • SharePoint Administrator or Site Collection Administrator permissions for the affected site.

  • SharePoint Online Management Shell or PnP PowerShell installed and configured on your local machine.

The most effective way to fully remove the theme is to use the theme's dedicated management script to deactivate its associated custom action on the site collection.

  1. Deleting the theme's SPFx package from the App Catalog does not fully remove the theme. Also, deactivate the theme's custom action on the specific site.

  2. If the custom action remains active, the theme will continue to load, especially if it was installed from the Tenant App Catalog.

  3. To complete the removal, run the theme installation script, select option "8 - Deactivate theme," and connect to the affected site.

The script will now proceed to deactivate the theme's custom action on the specified site collection.

Did this answer your question?