How to hide / remove attachment “alt” or “caption” field in Admin?

The attachment_fields_to_editfunction returns an array variable called: $form_fields, which contains all the data. So as it is an array, we could make any of these operations in this link.

There are some methods to delete an array element, including unset() method, which I think it’s the easy method to use.

And to delete the caption field, I’m not so sure but I think you should unset this: $form_fields['post_excerpt'], this contains the caption content. Take a look at the code function in this code link.