Technical information on this site may be out of date : no updates since 2015

Programatically Delete a content type in Drupal

May 5 2011 : posted under drupal snippet
<?php

$result = db_query("SELECT nid FROM node where type='mytype'");
while ($row = db_fetch_object($result)) {
    node_delete($row->nid);
}
node_type_delete('mytype');
?>

[2022: This is very old]