# How can I remove fields in the attachment editor?

Is it possible to remove a default attachment field from the attachment editor, for example the "Caption" field ?

To give you some context, I'm trying to build a custom attachment editor page. I found how to add custom fields, now I'd like to remove some of the default ones I don't need.

-
possible duplicate of Trying to hide buttons from Attachment window –  t31os Apr 15 '11 at 12:10

Use the attachment_fields_to_edit filter to remove the fields you don't want displaying from the array.

function remove_caption($fields) { unset($fields['post_excerpt']); // See wp-admin\includes\media.php line 1071
return \$fields;
}