How to delete ContentTypes in Sharepoint 2013/Office 365 using CSOM
In this article, we will learn about ContentType deletionĀ in Sharepoint 2013/Office 365 using CSOM. Below is the sample CSOM code to achieve the same. ClientContext cc = new ClientContext(siteUrl); cc.AuthenticationMode = ClientAuthenticationMode.Default; cc.Credentials = new SharePointOnlineCredentials(userName, pwd); Web web = cc.Web; ContentTypeCollection contentTypes = web.ContentTypes; cc.Load(contentTypes); cc.ExecuteQuery(); foreach (var item in contentTypes) { if (item.StringId […]