Title: Adding mime types with plugin
Last modified: August 20, 2016

---

# Adding mime types with plugin

 *  Resolved [Josh Maxwell](https://wordpress.org/support/users/tpschools/)
 * (@tpschools)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/)
 * I’ve tried a few plugins to add mime types including the [PJW Mime Config ](http://wordpress.org/extend/plugins/pjw-mime-config/)
   plugin; and, adding this code to a themes `functions.php` file could probably
   work, too, for a non-WPMS site. But I need these new mime-types allowed throughout
   the network.
 * So I’ve written my own plugin to do the trick. After looking at info from the
   codex as well several blog posts, this is what I’ve come up with:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * After activating the plugin on a 3.2.1 WPMS as well as a single 3.2.1 install,
   I’m experiencing problems. Upon activation:
 * > The plugin generated 3 characters of **unexpected output** during activation.
   > If you notice “headers already sent” messages, problems with syndication feeds
   > or other issues, try deactivating or removing this plugin.
 * Then when I attempt uploading a file matching one of the new mime-types I receive
   my original error message:
 * > **Warning:** Cannot modify header information – headers already sent by (output
   > started at [server]\wp-content\plugins\tps-mime-types\tps-mime-types.php:1)
   > in **[server]\wp-includes\pluggable.php** on **line 934**
 * I’m still new to WP, so any suggestions on what to do next?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Josh Maxwell](https://wordpress.org/support/users/tpschools/)
 * (@tpschools)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432566)
 * [Code here](http://pastebin.com/muKkpr3j).
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [14 years, 6 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432568)
 * Moving to Multisite, as the answers are different than on single-site 🙂
 * You shouldn’t need a plugin at all on Multisite.
 * Go to youdomain.com//wp-admin/network/settings.php
 * Add it to Upload file types
 *  Thread Starter [Josh Maxwell](https://wordpress.org/support/users/tpschools/)
 * (@tpschools)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432580)
 * Ipstenu, I thought the same thing at first, but when I added the extensions to
   that page, it still wouldn’t work.
 * However, I did end up figuring it out! 😀
 * Here’s [the new plugin code](http://pastebin.com/muKkpr3j). If anyone decides
   to use it: be sure to save code as `extended-mime-types.php` inside a folder 
   called `extended-mime-types/`. Also, create a text file called `mime-types.txt`
   inside of `extended-mime-types/`.
 * `mime-types.txt` must be formatted as follows:
 *     ```
       doc,doct application/msword
       pdf application/pdf
       ```
   
 *  [KevEd](https://wordpress.org/support/users/keved/)
 * (@keved)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432675)
 * Hi tpschools,
    which directory does the extended-mime-types folder need to be
   put in?
 * I updated my databas tables to list .doc etc – that gets rid of error messages
   but the files stil don’t upload, so I’m trying your code next.
 * Cheers.
 *  [Josh Maxwell](https://wordpress.org/support/users/hornetok/)
 * (@hornetok)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432676)
 * KevEd,
 * The files need to be put into `\wp-content\plugins\ap-extended-mime-types\`
 * So, inside the folder `new-extended-mime-types`, you should now have these files:
    1. mime-types.txt
    2. new-extended-mime-types.php
 * Or you can download the [plugin](http://ardentpixels.com/josh/wordpress/plugins/ap-extended-mime-types/).
   It’ll be on the WP repository as soon as I hear back from WordPress. There are
   no options, you just activate it and let it do it’s thing.
 *  [Josh Maxwell](https://wordpress.org/support/users/hornetok/)
 * (@hornetok)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432677)
 * [Plugin is online in the repository!](http://wordpress.org/extend/plugins/ap-extended-mime-types/)
   😀

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Adding mime types with plugin’ is closed to new replies.

## Tags

 * [add_filter](https://wordpress.org/support/topic-tag/add_filter/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 6 replies
 * 4 participants
 * Last reply from: [Josh Maxwell](https://wordpress.org/support/users/hornetok/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/adding-mime-types-with-plugin/#post-2432677)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
