In SharePoint Online we often deploy custom or 3rd party applications that have SPFx extensions. If you are not familiar with these, SharePoint Framework (SPFx) Extensions can be used to extend the SharePoint user experience. Using these extensions, you can customize more facets of the SharePoint experience, including notification areas, toolbars, and list data views. SharePoint Framework Extensions can be created for all Office 365 subscriptions.

As user and platform needs change over time, we might decide to remove some of those custom or 3rd party applications.  Once we decide to do that, the process may sometimes leave behind some of the SPFx custom actions or files related to them which may interfere with the site.

Scenario:

How to clean up stray custom action or SPFx extensions from SharePoint Online.

Resolution:

Run the following commands to remove the custom actions:

  • Install-Module SharePointPnPPowerShellOnline
  • Connect-PnPOnline -Url “https://siteURL” -UseWebLogin
  • $CustomAction = Get-PnPCustomAction -Scope All
  • Remove-PnPCustomAction -Scope Web/Site -Identity $CustomAction[0].Id -Force

If there are more than one custom actions, select the appropriate index number of the custom actions to be removed in the previous command.

Have questions? Need help building a scalable platform? Send us an email at info@peters.com or call 630.832.0075 to start the conversation.