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


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

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

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

$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)){
  //simple debug message so we can see what had been deleted.
  drupal_set_message("$deleted_count nodes have been deleted");

Edit Accordingly


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

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

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


  • 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.

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).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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