Hiding the ‘Create Site’ option in the Site Actions menu

2 minute read

Within SharePoint you have something called custom actions. You can use custom actions to create custom menu items within SharePoint. Besides custom actions you also have hide custom actions to hide custom actions. With the hide custom actions you can only hide custom actions that have been created with a CustomAction schema file.

The ‘Create Site’ menu options and also the ‘Create Page’ option are not created with a custom actions but on a different way. To hide these custom actions you can alter a file that resides in the masterpages gallery within a site collection.

In the masterpages gallery there is a folder called ‘Editing Menu’ in this folder there are four files you can use to alter certain menu options.

When you would like to hide the ‘Create Site’ action in the site actions menu you have to alter the CustomSiteAction.xml file by adding several nodes. Below there is an example of a CustomSiteAction.xml file that hides the ‘Create Site’ action:

<xml version="1.0" encoding="utf-8" ?>
<Console>
    <references>
<reference TagPrefix="cms" assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"   namespace="Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions" />
    </references>
    <structure>
     <ConsoleNode ConfigMenu="Delete" ChangedNodeID="wsaCreateSite" />
    </structure>
</Console>

The reference is to a SharePoint assembly that creates the custom actions. The ‘ConsoleNode’ stated what should happen with a certain menu action in the above example it is ‘ChangeNodeID’ which is ‘wsaCreateSite’ (This id can be found be looking in the source of the page). If you would also like to hide the ‘Create Page’ action you add the following line to the CustomSiteAction file:

<consolenode changednodeid="wsaCreatePage" configmenu="Delete" />

These changes can also be done with a feature and a feature receiver if you guys would like to have a example how to accomplish this let me now and also if you would like to see some examples for the other files.