Disable “Delete this site” option in SharePoint
There were many a times some of our users always want to test us whether we had a good backup of SharePoint Sites and Data. Traditionally speaking even though you have all the backups required to restore a SharePoint Site, it makes sense to disable the option to delete the site in first place.
So how can we do this?
Sure. There are a couple of options for deployment. The best one is to package this feature into a Solution Package (wsp). There are plenty of articles on the web with instructions on how to do this, and there are a number of different methods and tools you can use.
Also I think this would be one of the Best practices which will save tons of time for the Administrators trying to restore a single site or subsite in SharePoint
However, the quickest and easiest (to explain) way to get this deployed is to create the feature manually, as follows.
1. On your SharePoint server, browse to the folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
2. Create a new folder called HideDeleteWeb
3. Create two files in that new folder, one called feature.xml and the other called elements.xml
4. Paste the xml code shown below into the respective xml files. You can leave the guid as is. I generated that when I created the sample.
5. Open a windows command prompt, so that you can install the feature.
6. Type the following at the command prompt
stsadm -o installfeature -name HideDeleteWeb
7. You should get a message that the operation completes successfully
8. Browse to SharePoint Central admin website, then Web Application Management -> Web Application Features
9. You should see the Hide Delete Web Feature which you can activate on a web application.
Feature.xml
<Feature Id="{DBB60F9B-C30C-430c-B129-E943A9607ABC}"
Title="Hide Delete Web"
Description="Hide the delete this site link on the site settings page"
Version="1.0.0.0"
Hidden="FALSE"
Scope="WebApplication"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="elements.xml"/>
</ElementManifests>
</Feature>
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<HideCustomAction
Id="HideDeleteWeb"
GroupId="SiteAdministration"
HideActionId="DeleteWeb"
Location="Microsoft.SharePoint.SiteSettings">
</HideCustomAction>
</Elements>
August 14th, 2011 - 01:53
it`s a possible – hide by permissions?
August 14th, 2011 - 20:00
@ AVRam: Most of the scenarios, you have site collection admins and site owners who have full control on the site have the permission to delete the site by default. So if you can package a solution to deactivate the feature to delete the site will help you. Any ways in SP2010 Service pack1, we have the new feature “Site Recycle Bin” to recover or restore your deleted sites.