Deleting websites

  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; it uses a label control with ID lblInfo to display that the site was deleted:

 

[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/5_5r2/devguide/index.html?delete_web_site.htm