Rename an item

Version:

You can use the Sitecore.Data.Items.Item.Name property to rename an item. For example, to rename the /Sitecore/Content/Home/Sample item in the Master database to /Sitecore/Content/Home/Changed:

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

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

sample.Editing.BeginEdit();

sample.Name = "Changed";

sample.Editing.EndEdit();
If you have suggestions for improving this article, let us know!