Skip to content

Instantly share code, notes, and snippets.

@morad7
Created December 20, 2016 20:04
Show Gist options
  • Save morad7/4855629881520bd1d887a18ce8fab8d3 to your computer and use it in GitHub Desktop.
Save morad7/4855629881520bd1d887a18ce8fab8d3 to your computer and use it in GitHub Desktop.
Drupal: Delete all nodes of a given content type
$result= db_query("SELECT nid FROM {node} AS n WHERE n.type = 'TYPE'");
foreach ($result as $record) {
node_delete($record->nid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment