Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan Vermeerbergen 79 posts 112 karma points
    Oct 25, 2012 @ 02:46
    Jan Vermeerbergen
    0

    Delete content nodes?

    Hi,

    I need to delete about 250 content nodes (all of the same document type, but in different directories).

    Is there an easy way to do this? I have all the nodeID's.

    thanks

    J

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Nov 24, 2012 @ 03:01
    Lee Kelleher
    1

    Hi Jan,

    Not sure if you still need an answer for this one?

    I was going to suggest looking at the Content Maintenance Dashboard package - as this lets you select nodes of a certain document-type, then do bulk actions with them (e.g. move, unpublish, delete, etc).

    An alternative idea is to write a small snippet of C# inside a dashboard control to get all the nodes (from their IDs), loop through them, then delete.

    var docs = umbraco.uQuery.GetDocumentsByCsv("1111,2222,3333,4444,5555,6666,7777,8888,9999");
    if (docs != null)
    {
        foreach (var doc in docs)
        {
            doc.delete();
        }
    }

    Cheers, Lee.

     

  • Jan Vermeerbergen 79 posts 112 karma points
    Nov 26, 2012 @ 10:38
    Jan Vermeerbergen
    0

    Thank you, Lee!

Please Sign in or register to post replies

Write your reply to:

Draft