3

I need to delete all content of a content type. I'm allowed to select up to 50 node per deletion process. My problem is that I have 900 nodes then I need to repeat this 18 times.

Anyway to select all nodes to mass delete them?

5 Answers 5

5

Check the Views Bulk Operation module. This allows you to create list for exactly this purpose and gives you some other interesting functions.

1
  • The OP is not using views i think.
    – niksmac
    Apr 23, 2012 at 13:04
0

I dont see any modules, Try adding a custom page and put this code

<?php
$node_type = 'MYTYPE';
  //fetch the nodes we want to delete
  $result = db_query("SELECT nid FROM {node} WHERE type='%s'",$node_type);
  while ($row = db_fetch_object($result)){
    set_time_limit(20);
    node_delete($row->nid);
    $deleted_count+=1;
  }
  //simple debug message so we can see what had been deleted.
  drupal_set_message("$deleted_count nodes have been deleted");
?>

Edit Accordingly

0

Enable the Devel generate module, then use Drush, one command does it all, easy.

drush genc 0 --kill --types='your_content_type_name'
0

If you want to perform bulk operations, then I would recommend Administration Views module.

Features

  • Filter all administrative views via AJAX.
  • Perform any kind of bulk/mass operations on items in administrative views.
  • Filter content by title, node type, author, published status, and/or vocabulary.
  • Filter comments by title, author, node title, or published status.
  • Filter users by name, ban/blocked status, or user roles.
0

Can you try Delete all module, navigate to 'admin/content/delete_content' and you will be presented with a form for deletion of content belonging to certain content types. I tend to agree that this solution is more suitable for this use-case compared to the accepted answer (which is also a viable solution).

Regards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.