Left-over or ‘ghost’ tables after deleting fields in Drupal 7

Left-over or ‘ghost’ tables after deleting fields in Drupal 7

So you deleted some content type fields. Awesome!
Now you have a bunch of fields in your database that look like:

field_deleted_data_1
field_deleted_data_2
field_deleted_revision_1
field_deleted_revision_2

Why?
Drupal keeps them around, and even updates them, just because it can :)

How do you actually delete these fields/tables?
First, you need to modify field_config and field_config_instance and remove references to these fields first.

delete from field_config where deleted = 1;
delete from field_config_instance where deleted = 1;

Next, drop the field_deleted_* tables.

That’s it. You actually deleted the fields now.

Comments are closed.