Delete website

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following example shows how you can delete an existing website:

 

[C#]

 

using CMS.SiteProvider;

using CMS.CMSHelper;

using CMS.WorkflowEngine;

 

...

 

          // Code name of the site

          string siteName = "mysitecodename";

 

          // Delete records in CMS_Tree and CMS_Document

          DocumentHelper.DeleteSiteTree(siteName, null);

 

          // Delete other dependencies and the site

          SiteInfoProvider.DeleteSite(siteName);

 

           lblInfo.Text = string.Format("Site '{0}' has been deleted.", siteName);

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?delete_web_site.htm