Remove automatic exif titles for uploads
-
When uploading to the media manager, if the image has an exif title, the system automatically uses this.
I would like to remove this functionality, preferably without altering the core.
Reason: We rename our photos locally pre-upload. If there is no exif title, the system will use the file name, minus the dashes and extension. This is preferred.
Many cameras, especially Sony ones, enter “SONY DSC” for every photo’s title. This is poor for search engines, poor for readers, and makes sorting default gallery shortcode by title useless.
So, is there any way to stop this from happening during upload? Do not care about altering what shows publicly after the fact, would like it never to happen so that automatic filename->title method is used always, and we can print/sort using title again.
Thanks!
Edit – looks like it’s in wp-admin/includes/media.php
Want to alter function media_handle_upload()
And remove this block completely:
// use image exif/iptc data for title and caption defaults if possible if ( $image_meta = @wp_read_image_metadata($file) ) { if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) $title = $image_meta['title']; if ( trim( $image_meta['caption'] ) ) $content = $image_meta['caption']; }
So, any suggestions on how to do that without altering that file directly?
- The topic ‘Remove automatic exif titles for uploads’ is closed to new replies.