Customize Acceptable Upload File Types

| February 21, 2011 | Leave a Comment

WordPress Garage points out that there’s a limited list of allowed file types that you can upload via the WP admin. For certain custom sites, since WordPress is being used for everything these days, that may need to be modified and Chris Meller shows us how.

As of WordPress 2.2, there are 35 allowed file types configured in the default install. While there’s no admin-based tool for editing this list (nor any plugins that I’m aware of), it’s not at all difficult to add your own…

The idea is to add a custom function inside your theme’s functions.php to be used as a filter. In that function you can then add specific file extensions and their corresponding mime types. On the other hand, to remove a file type that’s allowed by default, use the function unset().

Sounds simple and painless! Of course, keep in mind that limitations are put in place to keep WordPress secure, so tread carefully. Also, for reference, there’s a list of the accepted filetypes at the WordPress.com Support section, but that may vary on a self-hosted install.

Related Posts

Tags: , , , , , , , , ,

Leave a Reply