AP Extended MIME Types
Idea: Exclude file types (6 posts)

  1. Ed
    Posted 3 years ago #

    You have any thoughts about adding exclusion of file types? Can't find anything that does this currently, would love a way to block MP3 uploads without having to edit wp-includes/functions.php.




  2. Ed
    Posted 3 years ago #

    Anyone else interested in this can add the following to the plugin, although there are actually plugins out there that do the same. Would be nice to add either another text file to add exclusions to or write an admin page for it.

    add_filter('upload_mimes', 'restrict_mime');
    function restrict_mime($mimes) {
    $mimes = array(
                    'mp3' => 'audio/x-mpeg'
    return $mimes;

    This will block MP3's being uploaded unless the user has unfiltered uploads on their account.

  3. Josh Maxwell
    Plugin Author

    Posted 3 years ago #

    Nice one, Ed!

    I'm working on adding a Settings page to edit the text file. I'll see what I can do to get your filter added in, too!


  4. Ed
    Posted 3 years ago #

    Cool, I'd double check that code though. Think it broke all uploads when I used it, needs tweaking. Will update when I get a chance to test it again.

  5. vinaysagar4u
    Posted 3 years ago #

    @Ed: Why dont you just go to your network settings and delete those file types you dont like?

  6. Ed
    Posted 3 years ago #

    I think I tried that and it still allowed them due to WordPress's defaults.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • AP Extended MIME Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic