Mp3 file type upload not permitted for security reasons

I’ve tried a dozen different ways to solve this including editing the functions.php file and I don’t see any plugins that are compatible with my theme to modify allowed file upload types. Does X not support video and audio files upload to the WP media folder?

This is the code I added to the functions.php file and I can now upload mp4 files so I can use mp4 extension on audio files to get them into my media database but those play in a video player which just looks awful. How can I upload just an audio file.

add_filter(‘upload_mimes’, ‘add_custom_upload_mimes’);
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes[‘mp3’] = ‘audio/mp3’;
$existing_mimes[‘mp4’] = ‘video/mp4’;
$existing_mimes[‘mp4a’] = ‘audio/mp4’;
return $existing_mimes;
}

Hi @kevinwenning,

Thank you for writing, the X theme has nothing to do with the file type restriction it’s either the Wordpress or your server setup or a plugin is conflicting.

Wordpress allows .mp3 file by default, maybe yours do not try adding this to your wp-config.php file.

define('ALLOW_UNFILTERED_UPLOADS', true);

Please add this line of code before the line that says /* That's all, stop editing! Happy blogging. */:

If the issue persists, please do testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Lastly, if the issue still persists, please contact your hosting and ask what restricting the .mp3 file.

Let us know how it goes,
Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.