Skip to main content
added example code
Source Link
Gatogordo
  • 20.3k
  • 2
  • 39
  • 100

WriteIf your items are spread around the tree, write some code to do it and wrap it in all disablers you can. This This blog has some nice info about it.

The SecurityDisabler will help the process a lot as no security is checked anymore. Disabling all events and index updates will also free a lot of resources for the actual delete.

You will need to clear the Sitecore caches and rebuild any indexes that refer to the items that you were updating afterwards as no events or index updates will be done.

Example:

using (new SecurityDisabler())
using (new DatabaseCacheDisabler())
using (new EventDisabler())
using (new BulkUpdateContext())
{
  try
  {
    Sitecore.Configuration.Settings.Indexing.Enabled = false;
    
    // delete items here
  }
  finally
  {
    Sitecore.Configuration.Settings.Indexing.Enabled = true;
  }
}

Write some code to do it and wrap it in all disablers you can. This blog has some nice info about it.

The SecurityDisabler will help the process a lot as no security is checked anymore. Disabling all events and index updates will also free a lot of resources for the actual delete.

You will need to clear the Sitecore caches and rebuild any indexes that refer to the items that you were updating afterwards as no events or index updates will be done.

If your items are spread around the tree, write some code to do it and wrap it in all disablers you can. This blog has some nice info about it.

The SecurityDisabler will help the process a lot as no security is checked anymore. Disabling all events and index updates will also free a lot of resources for the actual delete.

You will need to clear the Sitecore caches and rebuild any indexes that refer to the items that you were updating afterwards as no events or index updates will be done.

Example:

using (new SecurityDisabler())
using (new DatabaseCacheDisabler())
using (new EventDisabler())
using (new BulkUpdateContext())
{
  try
  {
    Sitecore.Configuration.Settings.Indexing.Enabled = false;
    
    // delete items here
  }
  finally
  {
    Sitecore.Configuration.Settings.Indexing.Enabled = true;
  }
}
Source Link
Gatogordo
  • 20.3k
  • 2
  • 39
  • 100

Write some code to do it and wrap it in all disablers you can. This blog has some nice info about it.

The SecurityDisabler will help the process a lot as no security is checked anymore. Disabling all events and index updates will also free a lot of resources for the actual delete.

You will need to clear the Sitecore caches and rebuild any indexes that refer to the items that you were updating afterwards as no events or index updates will be done.