By default if we delete item, it stores into Recycle Bin
. This is desire and essential behavior.
But if we want delete item permanently, can we do using any config
change?
Please suggest any approach.
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityBy default if we delete item, it stores into Recycle Bin
. This is desire and essential behavior.
But if we want delete item permanently, can we do using any config
change?
Please suggest any approach.
There is RecycleBinActive
setting.
Change it to false
and it should do the trick.
Just create a patch file Disable.Recycle.Bin.config
and add it to App_Config/Include
folder:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="RecycleBinActive">
<patch:attribute name="value">false</patch:attribute>
</setting>
</settings>
</sitecore>
</configuration>
We can do this using Sitecore PowerShell Extensions.
If don't want to store item into Recycling Bin
, need to pass Permanently
parameter. This is very fast and easy way which is recommended for bulk items deletion.
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
Get-Item "master:/content/Something" | Remove-Item -Recurse -Permanently
}
If you're working with a large volume
of data. In those cases you might also want to introduce the Sitecore.Data.BulkUpdateContext
technique, which will improve performance by avoiding event etc.
Note: Because this does disable events etc. You will probably need to re-index and run a smart publish once the items are deleted.
Please go through link https://doc.sitecorepowershell.com/working-with-items.html for more details .
If we passing Permanently
- Specifies the item should be deleted rather than recycled.
If you only need to do it occasionally, you can use the good old DB Browser at https://your-sitecore/sitecore/admin/dbbrowser.aspx
.
To do this manually on an occasional basis hold the shift key while pressing the delete key or choosing "Delete" of the context menu.