I have a visual studio 2012 solution with some features. This is deployed on the production environment. Now I have removed one of the features from the VS solution. I created a new wsp file and deployed on my production environment. But the feature is still available. What is the best practice to remove an existing feature?

The feature is now deactivated and from website scope.

3 Answers 3


I must say that beyond the actual commandlets to retract (more or less obvious), you need to asses what the feature is actually doing.

Simple answer - deactivate the feature via comandlets - but not before considering implications of that feature - what was it doing?


  • using Modules to deploy physical files? Than you should envision removing manually those files as feature/solution retraction does NOT do it for you (e.g. deploy CSS, master pages, media files - images, JavaScript)
  • Does your feature deploy Page Layouts (which might be in use ?)? Be aware that removing it would not Unlock Page layouts in use - so you would need to reset to other page layouts, and only than really clean up.
  • Does it perform any updates on configuration files - you need to Undo those changes
  • Does the feature deploy and attach any Event Handlers - you need to de-attach those or you shall get yourself a lot of errors from missing the actual assembly, class, etc.
  • Does your feature deploy any Site Definitions - even more trickier if used already.

These are just a few, are passing through my mind at a glance, which you should consider, beyond the actual removal via dedicated commandlets. Also, you would need sometimes to remove it physically from the FEATURE folder - from all Web Front Ends


The best will be to use powershell script to remove the Feature.

Uninstall-SPFeature -Identity "MyCustomFeature"




Best to follow the uninstallation and Retraction of a solution

  • Feature Deactivating
  • Retract solution
  • Remove solution
  • Deploy new solution

However you skipped those steps. If possible follow steps above and deploy old solution then follow steps again with the new solution

To remove faulty FeatureDefinitions and cleanly uninstalls you can use the feature admin tool on codeplex.

If that does not work and you stil have orphan features that you want to remove but can't you can create a sandboxed solution with inside a feature with the same feature id. Install the sandboxed solution and then remove the solution then the feature will be retracted.

  • I cannot retract and remove the solution. Because in this solution there are many features.
    – Ola
    Nov 12, 2013 at 8:29
  • added some extra methods for retracting features
    – Remko
    Nov 12, 2013 at 8:52
  • thanks, but can you explain why my feature is still available when I restract, remove the solution. Is this normal?
    – Ola
    Nov 13, 2013 at 9:52
  • A feature should first be deactivated before retract and remove the solution
    – Remko
    Nov 13, 2013 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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