WordPress handles media files through it’s Media Library and in it’s default installation only certain file types, or better said: MIME-types, are allowed to be uploaded.

The current selection of allowed file types (ie.the file types that are not banned) can be rather limiting specially when you’re using bbPress as a forum wiht your WordPress setup. I’m not sure about the need for additional formats for all bbPress forums, but in the Tweaking4All forum I most certainly would like to be able to upload RAR, 7z, GZIP, XML and CSV files (amongst others).

Unfortunately WordPress does not offer a straight forward interface in the Admin Pages to modify the allowed Files Types.
In this article a short piece of code to allow you to add other file types or so called mime-types.

Please keep in mind that files might be rejected based on other criteria, for example lack of disk space, because the file is larger than the maximum allowed file size or because your web-host does not allow particular files.

Note : If you’d like to allow larger files, you’ll need to edit the PHP configuration file (php.ini) and add or set the following lines in php.ini (the example allows files up to 32 Mb):

12

upload_max_filesize = 32M
post_max_size = 32M

Add Allowed File Types to WordPress

The approach in this article is straight forward: We will ADD file/MIME types to the existing list of allowed file types.

PAY ATTENTION TO SECURITY RISKS

For example HTML (.htm, .html), JavaScript (.js) and PHP (.php) file are types you’d better avoid as they can be “executed” on your server where you really would not want that to happen. For most of these kind of files, this should not be a problem though as these files are better off being compressed into a ZIP file anyway.

Only add file types that you REALLY need and that you are comfortable with.

2013

Donation options

Donations are very much appreciated, but not required. Donations will be used for web-hosting expenses, project hardware or a motivational boost (a drink or snack). Thank you very much for those have donated already! It's truly AwEsOmE to see that folks like our articles and small applications.