Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to turn off a feature using featuring stapling? How could you turn a feature off for all new sites that are created by default?

Edit

I have a feature staple to turn on publishing on each site. I want to turn off Wiki Page Home Page so that when you go to add a page the wiki page is not the default.

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

Don't think it is possible (anyone, fell free to correct me). But you can always do the opposite - staple a custom feature and deactivate the target features from the custom feature event receiver.

share|improve this answer
add comment

It depends. Normally you can just set the ActivateOnDefault=False in the feauture. Otherwise you can add an EventReceiver containing code to "turn off" the feature(s) you want.

You do this by opening your solution in Visual Studio > right click on the solutions top-level > Add new item > Event Receiver <-- By this stage a dialog will open in which you choose on what occation this EventReceiver should trigger and what phase of an event you want to manipulate, in this case the "Web Provisioned" phase. It then generates an EventReceiver in which a WebProvisioning method will be available to modify for your needs.

I hope this helps.

share|improve this answer
add comment

You can remove the feature reference in onet.xml

share|improve this answer
add comment

Your Answer

 
discard

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.