X

How to Upload Additional File Types to WordPress Media Library

upload additional file types in WP media library

Want to upload more file types to your WordPress media library?

You must have noticed that WordPress doesn’t let you upload all file types via media uploader due to security reasons. You can only upload certain files, like images (.jpg, .png and .gif), documents (.doc, .xls, .ppt, .pdf), audio files (.wav, .mp3, .mp4) and videos (.mpg, .mov, .wmv).

But at times you might want to upload more file types to your WordPress site, like .bmp images, .psd, .ai, .page documents, etc.

Let’s check out how to securely upload additional file types to your WordPress media library.

How to Enable Additional File Upload Support in WordPress

You can extend your WordPress media library support for more file extensions in 2 ways.

  • Method 1: Upload Additional File Type With a Plugin
  • Method 2: Upload Additional File Type Without a Plugin

Method 1: Upload Additional File Type With a Plugin

To enable additional file upload support in WordPress with a plugin, you’ll first need to install and activate the free File Upload Types plugin.

file upload types, additional file support in wp

With this plugin, it’s easy for you to extend your website’s support for more file types.

The plugin works by letting you adjust the internal file whitelist. You can manually control which types of file extensions your site can upload.

Configuring the File Upload Types Plugin

Once the plugin is installed and activated on your WordPress website, go to Settings » File Upload Types

File Upload Types by WPForms , addition file support in wordpress

You’ll see a list that shows you different file formats. To extend the support for more file types, you can select the right file extensions in the list. If you don’t see the file extension that you want to upload, scroll down until you find Add Custom File Types. Then add the details in there.

File Upload Type, WPForms

If you want to extend the support for more than one file type, use the ‘+’ symbol next to the Extension field. Once done click on the Save Settings button at the bottom of the screen. You should now be able to upload your desired file format easily.

Method 2: Upload Additional File Type Without a Plugin

If you don’t want to install a plugin to upload additional file types, simply add this code snippet to your functions.php file or your site-specific plugin.

 function my_myme_types($mime_types){
          $mime_types['svg'] = 'image/svg+xml'; //Adding svg 
extension
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

In the above code, you’ll notice that the file extension goes as the key in $mime_types associated array and the mime type goes as its value. In this example, the svg file extension represents files with the mime type image/svg+xml.

If you want to add multiple file types you can do that by using this:

function my_myme_types($mime_types){
    $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
    $mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

Once done, don’t forget to save your settings.

We hope this post helped you upload additional file types to your WordPress media library. You might also want to read about the best file upload plugins for WordPress.

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[60% OFF Today!]
[60% OFF Today!]
[50% OFF Today!]
[50% OFF Today!]