Delete a field instance

Public

Deleting a field instance using update hook

</> CopyGet raw version
php
  1. function hook_update_N() {
  2. // Remove my_field from *only* the specified content type.
  3. $instance = field_info_instance('node', 'my_field', 'content_type_name');
  4. field_delete_instance($instance, TRUE);
  5. field_purge_batch(1);
  6. }