---
title: "Delete the descendants of an item"
slug: "delete-the-descendants-of-an-item"
abstract: "How to delete the descendants of an item using the Sitecore.Data.Items.Item.DeleteChildren() method."
---
# Delete the descendants of an item

You can use the `Sitecore.Data.Items.Item.DeleteChildren()` method to delete the descendants of an item. For example, to delete the descendants of the `/Sitecore/Content/Home` item in the Master database:

```

Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");

Sitecore.Data.Items.Item sample = master.GetItem("/sitecore/content/home/sample");

sample.DeleteChildren();

```

> [!note]
> You cannot delete items that are stored in resource files. If you have copied an item from a resource file to the database, Sitecore deletes it from the database and restores it from the resource file.