SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found some orphaned features under "_layouts/ManageFeatures.aspx?Scope=Site" but they do not show up when I list them up with powershell (get-spgetfeature -site url). They are not in 14 hive and cannot be found through the "SharePoint Manager".

What can I do to remove these features?

share|improve this question
Similar question – Anatoly Mironov Nov 18 '13 at 15:49

I have had this problem, too. The reason why they don't show up in PowerShell is the missing Scope, those feature are orphaned, indeed. We cannot use -Site parameter. What you can is to list it in PowerShell without -Site parameter and filter out those without Scope:

Get-SPFeature | ? { $_.Scope -eq $null }

This will give you a complete list of orphaned features.

Obviously, I had a lot of orphaned features on my Development Environment

Now you have to find your feature and delete it. You cannot use Id for getting your feature, neither use Unistall-SPFeature cmdlet with Id:

Uninstall-SPFeature : Cannot find a Feature object with Path or Id: a4d208a3-b4fa-4bca-bb34-be4d30156b63 in scope Local farm. At line:1 char:1 + Uninstall-SPFeature a4d208a3-b4fa-4bca-bb34-be4d30156b63 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Share...ninstallFeature:SPCmdletUninstallFeature) [Uninstall-SPF eature], SPCmdletPipeBindException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletUninstallFeature

The workaround is to use the DisplayName to get the spfeature (actually SPFeatureDefinition) and then delete it.

$feature = Get-SPFeature | ? { $_.DisplayName -eq "My_Orphane_Feature" }

I have tested this code and it has worked for me.

You can even use this code to clean all the orphaned features:

Get-SPFeature | ? { !$_.Scope } | % { $_.Delete() }

This line of code gets all the orphaned features and removes them.

share|improve this answer
Thanks very useful made my day – user25445 Apr 28 '14 at 20:41
Thanks, just had to use this myself - one dev box, multiple dev branches, not retracting a newer branch before deploying an older one = orphaned features when deploying the old one over the new :( – James Love Nov 11 '14 at 15:10
Thanks this worked! Used Uninstall-SPFeature and stsadm -o uninstallfeature but none worked..then finally found your script above and that worked! – Ransher Singh Feb 17 '15 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.