We have several thousand MP3 files that were transferred to WP (from a dying Drupal site) via a custom script by the developer, with whom we don't have contact anymore. Wordpress, however, doesn't recognize those files' mime type:
The server (debian lamp stack) shows that the file has the correct mime time associated with it:
# file --mime-type 1-14_FNC.mp3
1-14_FNC.mp3: audio/mpeg
Is there a plugin or script that can go through these old files and assign the correct type within Wordpress? (needed to offload them onto s3 with another plugin, heh. That script fails with an empty mime type.)
We have several thousand MP3 files that were transferred to WP (from a dying Drupal site) via a custom script by the developer, with whom we don't have contact anymore. Wordpress, however, doesn't recognize those files' mime type:
The server (debian lamp stack) shows that the file has the correct mime time associated with it:
# file --mime-type 1-14_FNC.mp3
1-14_FNC.mp3: audio/mpeg
Is there a plugin or script that can go through these old files and assign the correct type within Wordpress? (needed to offload them onto s3 with another plugin, heh. That script fails with an empty mime type.)
Share Improve this question asked Oct 20, 2020 at 15:42 DeannaDeanna 11 Answer
Reset to default 0I was able to update the mime types via MySQL -- here's the update query I used:
UPDATE `wp_posts` SET `post_mime_type` = 'audio/mpeg' WHERE `post_name` LIKE '%mp3%' AND `post_mime_type` != 'audio/mpeg'
Setting this also made the correct metadata for the files appear, and the offload plugin worked as expected.
HURRAY