Saturday, 2 June 2018

How to Archive and Restore Sitecore Items programmatically

Content Author can archive items any time from Sitecore client by using Archive button in the Review tab.

And later can restore the archived items form the Archive application.

However, we can have a situation where we need to archive or restore items based on some action.
Following is the code which can be used to archive items programmatically:

Here, "list" is the list of items you want to Restore.
Following method can help you restore all archived items:


  1. Hey,

    Any ideas on how to archive a certain version, or only a certain language version of the item?


  2. Use archive.ArchiveVersion() this method to archive certain version