Created
December 20, 2016 20:04
-
-
Save morad7/4855629881520bd1d887a18ce8fab8d3 to your computer and use it in GitHub Desktop.
Drupal: Delete all nodes of a given content type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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