Last active
May 5, 2018 21:23
-
-
Save init90/6e1821ff87ee13e23c62b5bda912e604 to your computer and use it in GitHub Desktop.
Drupal 7, delete all nodes from content type.
This file contains hidden or 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
$nids = db_select('node', 'n') | |
->fields('n', array('nid')) | |
->condition('type', 'quiz') | |
->execute() | |
->fetchCol(); | |
node_delete_multiple($nids); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment