0

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:

A screenshot of the Media Library overlay showing an empty field for the file 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.)

0

I 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.