I am on D7. In the past, I have deleted the body field from a certain content type in my project. Now, the problem is that I want the body field back into this same content type, but cannot find it in the list of existing fields in my project to be added to the content type. How can I add the deleted body field back into the content type? Is it possible? It is important to say that I don't want its content back. I just want the regular Body field with the original ID body, instead of creating a "field_body". Thanks.

6 Answers 6


In a hook_update_n(), module_install(), module_enable(), or devel module eval php code:

$types = node_type_get_types();

giving it the machine name of your content type, and optionally you may provide a label for what you want the human readable label for the field to be (defaults to 'Body'). see node_add_body_field() API documentation

  • tenken, is it possible to do it from the Rules module? Are there any actions there where I could run custom PHP code and get this body field created? Thank you. Jul 3, 2012 at 13:48
  • wow really dont know typcially you make fields/content types and then Rules acts on these created types/things ... I wouldnt be able to guess what you would hook into to fire this before you try to access this field to add $body content to anything ... maybe look at drupal.org/project/entitysync ....
    – tenken
    Jul 3, 2012 at 21:39
  • See below comment - this example won't work, $type is an object.
    – Renee
    May 7, 2013 at 22:36
  • @Renee I havent declared what $type is here in code. My code links to the actual API documentation. I assume the developer knows what $type an element from the $types array. I try to make my examples as clear as possible, sorry if it fell short -- you can edit my answer if you want.
    – tenken
    May 8, 2013 at 1:05

In Drupal 7, I think that if you create a new content type, it appears with default "body" field. So it appears again in "existing fields" menu too. Then you can select it for any other conent type and after that you can delete the new content type created for this pourpose.


With drush I used

drush  php-eval '$types = node_type_get_types(); node_add_body_field($types["content_type_name"], $label="Body");'
  • Hello and welcome. Please avoid code-only answers. Explanation is worth more - especially if your code will happen not to work in OP's environment exactly the way it works in yours.
    – Mołot
    Aug 8, 2014 at 9:19
  • Good example of how to do this with drush thanks !
    – devunder
    Oct 7, 2016 at 10:00

In a hook_update_n or module_install() or module_enable $types = node_type_get_types(); node_add_body_field($types['my_content_type_name'], $label='Body');

  • This looks very similar to the previous answer... Mar 14, 2013 at 17:42
  • 1
    This answer is correct. node_add_body_field expects the first parameter to be a node type object.
    – avr
    Apr 4, 2013 at 18:05

insert directly into the field_config_instance table: mysql> INSERT INTO {{database}}.field_config_instance ( field_id, field_name, entity_type, bundle, data, deleted) VALUES ( '2', 'body', 'node', '{{your-content-type}}', '{{blob-data}}', '0');

I copied the blob data separately from an existing content type via MySQLWorkbench and omitted 'id' from the query, which is an auto-increment field


Just found out that if you simply have another content type created and has the default BODY field on it, you can simply add it to your needed content type from the Add existing field section on the Manage fields tab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.