Well, the answer lies on the surface:
$types = array('my_content_type_name'); $nids_query = db_select('node', 'n') ->fields('n', array('nid')) ->condition('n.type', $types, 'IN') ->range(0, 500) ->execute(); $nids = $nids_query->fetchCol(); entity_delete_multiple('node', $nids);
I advise you to use a "range" and some kind of "batch" (or just re-run the code several times), because it is a very thick operation (500 nodes per operation in order for 256 MB).
To execute this code, you can write your own module or use the devel module: https://www.drupal.org/project/devel p>
After installation, go to yoursite_address / devel / php and execute the php code there.
source share