Change which type of files you can upload in WordPress

by Aaron Reimann

September 21, 2012

We recently had a client that needed to be able to upload a “vCard” and they were not able to do so. That is because WP limits what type of files can be uploaded. By default you can only upload media to the “Media Library”, which makes perfect sense, right? But what if we need to upload PowerPoint, Word documents, etc, well, here is the code that allows you to do that.

Go to the theme’s functions.php file and drop in the code (within the tags that should already be at the top of the file).
[cc lang=”html”]
add_filter(‘upload_mimes’, ‘custom_upload_mimes’);
function custom_upload_mimes ( $existing_mimes=array() ) {
$existing_mimes[‘vcard’] = ‘application/x-vcard’;
$existing_mimes[‘vcf’] = ‘application/x-vcf’;
return $existing_mimes;

photo credit: bs-iv-folie-2 via photopin (license)

related posts

Font Awesome icon

How to add a Font Awesome icon as a menu item

I’ve started recording a lot of videos, this being the first, for 48in48 (If you don’t…

A Page Builder Must Have Add-On

Page builders are more common in the WordPress community now than ever.  There has been…

Beaver Builder Visual Hook Guide How To

One of the guys (Bret) showed me this plugin that is on GitHub and I…