How to retrieve a list of fields, similar to what is available at admin/reports/fields, but so that I can have them in an array that I can stuff in a select dropdown.

2 Answers 2


You should use field_info_fields(), which returns an array containing information about all the defined fields. Its output is similar to the following one.


  • What tools did you use to display the array in this format? :)
    – Mario Awad
    Commented Sep 20, 2012 at 8:51
  • 2
    You can use the Devel module from drupal.org/project/devel eg in a custom module dpm(field_get_fields());. Devel also has a Fields information block where it lists out basically the same information as the above 1 line of code.
    – tenken
    Commented Sep 21, 2012 at 14:41

You can also use field_info_field_map() it returns a lightweight map of fields across bundles. field_info_fields() also return fields list but its document suggesting us "Use of this function should be avoided when possible, since it loads and statically caches a potentially large array of information.".

The function only returns active, non deleted fields.

$field_list = field_info_field_map();


enter image description here

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.