Remove web property from SharePoint
Seems like a trivial task, but there was a problem that sometimes property wasn't removed. Here is the method, how to update correct objects
public static void RemoveWebProperty(SPWeb web, string webPropertyName)
{
if (web.Properties.ContainsKey(webPropertyName))
{
web.AllProperties.Remove(webPropertyName); //first clear from AllProperties.
web.Properties[webPropertyName] = null; // remove property value
web.Update(); //update web object.
web.Properties.Update(); // update properties object.
}
}