Skip to main content
Updated example.
Source Link
Michael West
  • 18.6k
  • 2
  • 42
  • 105

This is another option you have if you want to use Sitecore PowerShell Extensions. Delete the items in a BulkUpdateContext - this disables events etc... an so makes the delete run a lot faster. To do that in SPE you can use this syntax:

Import-Function -Name New-UsingBlock

New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
    Get-Item -Path master:/sitecore/Content/myItem | Remove-Item
}

Because this does disable events etc... you will probably need to re-index and run a smart publish once the items are deleted.

This is another option you have if you want to use Sitecore PowerShell Extensions. Delete the items in a BulkUpdateContext - this disables events etc... an so makes the delete run a lot faster. To do that in SPE you can use this syntax:

Import-Function -Name New-UsingBlock

New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
    Get-Item -Path master:/sitecore/Content/myItem | Remove-Item
}

Because this does disable events etc... you will probably need to re-index and run a smart publish once the items are deleted.

This is another option you have if you want to use Sitecore PowerShell Extensions. Delete the items in a BulkUpdateContext - this disables events etc... an so makes the delete run a lot faster. To do that in SPE you can use this syntax:

New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
    Get-Item -Path master:/sitecore/Content/myItem | Remove-Item
}

Because this does disable events etc... you will probably need to re-index and run a smart publish once the items are deleted.

Source Link
Richard Seal
  • 20.8k
  • 5
  • 44
  • 79

This is another option you have if you want to use Sitecore PowerShell Extensions. Delete the items in a BulkUpdateContext - this disables events etc... an so makes the delete run a lot faster. To do that in SPE you can use this syntax:

Import-Function -Name New-UsingBlock

New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
    Get-Item -Path master:/sitecore/Content/myItem | Remove-Item
}

Because this does disable events etc... you will probably need to re-index and run a smart publish once the items are deleted.