Last Updated: February 25, 2016
·
625
· luukyb

Drupal delete field programmatically

In your custom module, this is very useful when using hook update.

// Removes field "field_title".
$field = 'field_title';
field_delete_field($field);
field_purge_batch(1);
watchdog('my_module_machine_name', 'Deleted :field_name.', array(':field_name' => $field));