Considering that you will come up with a solution to the accessibility issue pointed by @toscho…
Putting a lower priority (later execution) to the filter does the job.
$priority (integer) (optional)
Used to specify the order in which the
functions associated with a particular action are executed. Lower
numbers correspond with earlier execution, and functions with the same
priority are executed in the order in which they were added to the
action.
Default: 10
function remove_caption( $fields ) {
unset( $fields['image_alt'] );
return $fields;
}
add_filter( 'attachment_fields_to_edit', 'remove_caption', 999, 1 );
Related Posts:
- Filter to remove image dimension attributes?
- Change WordPress image URLs via filter
- Always use for post images
- Change html structure of all img tags in WordPress
- Default Image Link Removal
- Remove title attribute from images
- hook into completed image upload filter
- Need help building a filter to edit the output of “image_send_to_editor”
- Filter Media Library by author or post_parent
- Preview Image Path in Admin Section
- How to display a shortcode caption somewhere other than the_content
- Alter image output in content
- add data-attribute to all images inside the_content()
- Filter to modify post_title after image upload?
- Change html structure of all img tags in WordPress
- Make alt text required when setting a featured image
- Disable wordpress image sizes generation
- Extend core block attributes in post content
- What’s the proper way to use the get_image_tag filter?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- How to get image ID to use inside wp_read_image_metadata()?
- Is there any action/filter hook to use when an image gets edited in the editor?
- How to create ‘Local’ filters for WordPress srcset sizes in template parts?
- Customizing the attachement page to show rest of all images in a gallery from post
- How to add custom classes to figure element only if image has caption?
- Change align classes for images
- How to filter the image embed code based on link type
- Add custom text in the media library image meta area
- WP 5.3 Removing Default WordPress Image Sizes
- Filter for post_thumbnail: link to small src and add data-attribute [duplicate]
- Remove Image Sizes in Media Settings Page
- How can I use wp_save_image_editor_file filter?
- How to stop WordPress from completely overriding my tags in my templates?
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- How can I change the to for lazyload wp smilies
- How to display a warning when an uploaded image is too small?
- How to change an image source when rendering on frontend?
- How to change Gallery image url in product page ? In function.php?
- How to get title of images in post content
- How to generate alt attributes with php / filters?
- attachment_fields_to_save first parameter is null
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- js alert in add_filter function for image_send_to_editor
- Dinamically modifying attributes of images on posts
- How to attach post ID to image links in WordPress tinymce editor
- image_send_to_editor filter – Unwanted paragraphs and line breaks
- How might one programmatically set the link for all images in all posts?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Surround uploaded image link with div
- Removing image dimensions from `the_content`
- Rename uploads filenames to POST-ID on upload
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to add a link to media file for every image inserted in content?
- Replace image with its alt text?
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Neither intermediate_image_sizes_advanced or intermediate_image_sizes filter is firing
- ‘Add Media’ to post – filter images
- ‘apply_filters’ is breaking some shortcodes/HTML but not all
- get_post_gallery_images returns thumbs . I want full size
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- WordPress speed slow after .5 million single image post via wp-cli
- There’s some way to add a wrapper around posted images?
- How to disable the suffix “-scaled” which is being added at the end of each uploaded image?
- In media library images are not displaying run time [closed]
- How to get image extension from wp image editor object?
- Add a new data attribute in tag
- Watermark images only for some users
- Domain Change with New Image Sizes
- Why no images on a fresh WordPress installation?
- How to stop thumbnail generation from some images and different size thumbnail generate
- wordpress (woocommerce) add image to media library programmatically python
- How can I filter image HTML to add schema.org attributes?
- How to get file URL from media library
- How to add image in rss?
- Rewrite inline image markup
- How to set a Background image in WordPress?
- Images don’t load erratically
- Weird encoded error when using wp_generate_attachment_metadata()
- I want to rel=nofollow wordpress images
- Local install not loading template images but is loading everything else XAMPP
- Add a span tag around image
- fitting the thumbnail image into a div
- Attachments without images
- Editing already up-loaded images
- wp_insert_attachment() dupplicate attachment posts
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- link image file path embedded HTML
- get_post_meta returning broken path in image src
- Custom WordPress Theme – No Slider(s) Images
- Get image from one page and show/add it on another page
- Images not showing after moving site
- Garbled HTML pulled for page description “caption id=attachment…”
- Media upload in add comment meta box
- How do I set the sizes of my thumbnails when inserting a [gallery]?
- Featured Image not changing
- has_post_thumbnail() Returns False on Scheduled Posts
- Automatically adding blog images to a portfolio/gallery
- Best practice for WordPress media image use
- Customize all image captions