Simple snippet on how to delete nodes programmatically in drupal 8.
$result = \Drupal::entityQuery("node")
->condition('created', strtotime('-30 days'), '<=')
->execute();
$storage_handler = \Drupal::entityTypeManager()->getStorage("node");
$entities = $storage_handler->loadMultiple($result);
$storage_handler->delete($entities);