I am currently facing the Issue of having a few thousand child nodes, that have been created on a certain date, I need to delete. I know it sounds a bit insane, but it is not possible for me to delete all of these by hand since opening the parent node in the Webinterface hangs all of my browsers. I started with an approach to first get all the Child nodes which works perfectly but I simply cannot find a mention in the API documentation on how to delete a node.
Hi,
you can change to view the children in List View by selecting this for the parent doctype, then change the 'List View - Content' data type to display, saw 100 records at a time, then you can select all 100 records at a time and delete them in batches. I wouldn't delete many more than that at a time or you'll probably get timeouts.
Delete Child Nodes programmatically
Hey Umbraco Community,
I am currently facing the Issue of having a few thousand child nodes, that have been created on a certain date, I need to delete. I know it sounds a bit insane, but it is not possible for me to delete all of these by hand since opening the parent node in the Webinterface hangs all of my browsers. I started with an approach to first get all the Child nodes which works perfectly but I simply cannot find a mention in the API documentation on how to delete a node.
Is there even a way to do this?
Best regards,
Josh
Hi, you can change to view the children in List View by selecting this for the parent doctype, then change the 'List View - Content' data type to display, saw 100 records at a time, then you can select all 100 records at a time and delete them in batches. I wouldn't delete many more than that at a time or you'll probably get timeouts.
You can also delete nodes using the ContentService if you prefer to do this programmatically, but I'd also do this in batches of no more than 100-200 at a time or you'll probably bring the site down. ContentService docs (for v8) are here: https://our.umbraco.com/apidocs/v8/csharp/api/Umbraco.Core.Services.IContentService.html
HTH
t
Thank you very much for your helpful answer. This truly helps. <3
I will use the List view approach as it is really the easiest way :)
is working on a reply...