How to Delete All Nodes of a Given Content type in Drupal?

| | 1 min read

Have you ever faced problems trying to delete all the contents of a particular content type in a Drupal website? Drupal is a CMS technology and supports Drupal developers/content writers to add content. I think content writers can face problems while trying to delete content. There are two modules in Drupal that help us overcome this issue, they are:

  • Views Bulk Operations
  • Delete all

Views Bulk Operations

Download the module directly from Drupal.org

 When you enable this module, a new global field named "Views bulk operations" will become available in every view. To enable Views Bulk Operations for the view, just add and configure this field. If the core bulk operations field is enabled (for example, Node operations bulk form for the "Content" view), that field will need to be replaced with the Views bulk operations field.

Delete all

'Delete all' module helps us to delete all contents. Download the module from Drupal.org. After enabling the module, go to Administer > Content, then select all the nodes and delete them. This works if you have a handful of nodes only. If you have hundreds or more nodes,  using this module will not be a practical solution.

These two modules are simple and effective for Drupal developers and Drupal content writers to delete content.

Note: There is a simple workaround for this with the devel module as well.

Reference

https://drupal.stackexchange.com/questions/537/how-to-delete-all-nodes-of-a-given-content-type