Created
December 17, 2010 00:26
-
-
Save billsinc/744277 to your computer and use it in GitHub Desktop.
Remove content from Drupal by 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
$node_type = 'lease'; | |
//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)){ | |
node_delete($row->nid); | |
$deleted_count+=1; | |
} | |
//simple debug message so we can see what had been deleted. | |
drupal_set_message("$deleted_count nodes have been deleted"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment