Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Add Additional File Types to Be Uploaded in WordPress

You can upload many common file types in WordPress, including images, videos, audio files, and office files. However, some website owners need to upload files that are unsupported.

For example, over the years, many of our readers have asked us how they can upload SVG and other file types to WordPress. That’s why we went looking for a beginner-friendly way to do this.

In this article, we will show you how you can add additional file types for upload in WordPress.

How to Add Additional File Types to Be Uploaded in WordPress

Which File Types Are Allowed for Upload in WordPress?

For security reasons, you can only upload the most commonly used file types to your WordPress website or WooCommerce store. There is also a maximum size limit on the files that can be uploaded.

By default, the allowed file types and extensions are:

Images: .jpg, .jpeg, .png, .gif, .ico, .webp
Documents: .pdf, .doc, .docx, .ppt, .pptx, .pps, .ppsx, .odt, .xls, .xlsx, .PSD, .XML
Audio: .mp3, .m4a, .ogg, .wav
Video: .mp4, .m4v, .mov, .wmv, .avi, .mpg, .ogv, .3gp, .3g2

Tip: Although you can upload videos to WordPress, we recommend using a video hosting site instead. This helps protect your website’s speed and performance.

However, some types of files have the potential to be misused and can be a security risk, so WordPress doesn’t enable them by default.

Here is a list of file types that are blocked by WordPress:

Images such as .svg, .bmp
Documents like .psd, .ai, .pages
Code files such as .css, .js, .json
Video like .flv, .f4l, .qt

If you try to add new unsupported file types to your WordPress site, then you will see the error message, ‘Sorry, you are not allowed to upload this file type.’

You Are Not Allowed to Upload Some File Types to WordPress

But what if you need to upload an unsupported file format? You could upload the files through FTP or your WordPress host’s file manager, but that’s not as convenient as using the built-in WordPress media library or a file upload form.

Tip: If you are looking to upload images with the SVG extension, then you can check out our guide on how to add SVG files in WordPress.

Let’s take a look at how to add additional file types to be uploaded in WordPress.

How to Add Additional File Types to be Uploaded in WordPress

Some tutorials will tell you to edit your functions.php file and add a PHP code snippet there. However, we think the easiest and safest way to enable different file types is with a simple plugin.

First, you need to install and activate the free File Upload Types by WPForms plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

It’s one of the best file upload plugins and is the easiest way to add support for additional file types to WordPress. It was co-created by WPBeginner’s founder, Syed Balkhi.

Using Preset File Types

Upon activation, you need to go to the Settings » File Upload Types page in your WordPress admin area. Then, you can simply scroll through the list of preset file types or enter a file type into the search box.

Add a File Type by Clicking a Checkbox

Next, check the boxes next to the file types that you want to enable.

Once you are finished, go ahead and click the ‘Save Settings’ button at the bottom of the screen to store your changes.

Click the Save Settings Button

Now, you will be able to upload those file types using the WordPress media library.

Adding Custom File Types

If the file type you want to add wasn’t included in the list of presets, then you can add it as a custom file type.

When you scroll down to the bottom of the File Upload Types screen, you will come to a section labeled ‘Add Custom File Types’. Here, you can add a new file type by entering a description, MIME type, and file extension.

To add another custom file type, simply click the ‘+’ icon at the end of the line. When you are done, don’t forget to click on the ‘Save Settings’ button to store your changes.

Add Custom File Types to WordPress

For example, if you wish to add the YAML file type, then you would type ‘YAML file’ in the description, ‘text/yaml’ in the MIME type field, and ‘.yaml’ as the file extension.

MIME (‘Multipurpose Internet Mail Extension’) is a standard way to identify files on the web. The easiest way to learn a file’s MIME type is to use a MIME File Type Checker.

We hope this tutorial helped you learn how to add additional file types to be uploaded in WordPress. You may also want to learn how to create a file upload form in WordPress or check out our list of the top plugins and tips to improve the WordPress admin dashboard.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

44 CommentsLeave a Reply

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Rob

    Worked wonders! Saved me hours, thanks for this!

    • WPBeginner Support

      Glad our guide was helpful!

      Admin

  3. Richard

    Can i have a virtual store on my eCommerce wp website?

    • WPBeginner Support

      You are able to have a store on your site if you want :)

      Admin

  4. Reinette

    If this is a beginner’s tutorial then I would need the pre-beginner tutorial :(

    All I want to do is upload .mobi and .epub files to my Woocommerce store and I can´t find any help that I’m able to understand. Why is this so difficult?!

  5. kevin kipkirui koech

    YEEEES it workd for me to uploa ApK file android apk
    her is the code i added at the bottom of functions.php

    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
    $mime_types[‘apk’] = ‘application/vnd.android.package-archive’; //Adding apk files
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

    • WPBeginner Support

      Great, glad our guide could help and nice job getting it worked out :)

      Admin

  6. Ali Hassam

    Please make blog on how to make download option in the wordpress.

    I hope you understand what I said.If some one click ‘download`. It will download.

  7. ujwal

    i have added the below code in functions.php but when i’m trying to upload ‘svg’ files,i’m getting the same error. Please help me.
    ‘Sorry, this file type is not permitted for security reasons.’

    /********** code used ***************/
    //Adding different file format
    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);

    • WPBeginner Support

      You would want to reach out to your hosting provider, they are likely overriding the files allowed to be uploaded

      Admin

  8. Kymmie

    OMG! You saved me! I followed your instructions and I am now able to upload EPUB files to my form in Request Book Review page on my website. Thank you!

    • WPBeginner Support

      Glad our guide could help :)

      Admin

    • Sebastjan

      Can you paste your code for epub please? I’m not to good with coding.

      • Robin

        Allow All File Types

        You can also setup WordPress to allow to upload all file types. This can be performed with the help of a WordPress constant “ALLOW_UNFILTERED_UPLOADS”. You can set the WordPress constant “ALLOW_UNFILTERED_UPLOADS” to true” in wp-config.php file of your WordPress install. The wp-config.php file can be found in the root directory of your WordPress install. Using your favorite editor (vi editor) open the wp-config.php file and add the following line somewhere in the file. You can also use File Manager to edit the WordPress configuration file.

        define(‘ALLOW_UNFILTERED_UPLOADS’, true)

        Don’t forget to save the config file after editing.

        • WPBeginner Support

          The dangers of a method like this would be that you are allowing every file type to be uploaded to your site which removes some safety.

  9. rob thirlby

    I still cannot get csv uploads to work in 4.9.9 upwards of wordpress. Has anyone got a solution? Just adding the csv type to the list doesn’t seem to help. Is csv explicitly banned in the core somewhere.

  10. Sam Bean

    Is all this still good for Wordpress 4.9.2? I also could not find any mime types for Adobe Illustrator files (.AI and .EPS)

    Can you tell me what I would add to the file to be able to upload those 2 file types?

  11. Ajeet

    hello sir,
    i want to upload .exe file,but it shows an error.So what can i do

    • WPBeginner Support

      Hi Ajeet,

      You cannot upload it by default. You will need to allow .exe file types first. Please see the instructions in the above article.

      Admin

  12. Ravi Kanani

    I want to upload Embroidery Design file .emb
    In the page several common file extension .emb is not included.

    Please Give me code to upload .emb type of files.

  13. Dan

    Kevin’s code for KML/KMZ files worked perfectly for me. Thanks!!!

  14. Jaime

    I did what the instructions say and I still can’t upload .ogv files.

    I added this code to functions.php:

    function my_myme_types($mime_types){
    $mime_types[‘ogv’] = ‘video/ogg’; //Adding ogv extension
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

    Does anybody know why it doesn’t work?

    • loule

      same problem for me ;)

  15. Sarah

    This worked to allow me to initiate the upload of a dmg file, but when it says the is 100% complete, it doesn’t show up in the Media files, and it isn’t in the wp-content folder either, so I’m not sure why… any ideas?

  16. Alex

    How would I go about editing the snippet for android .apk files?

  17. Sajed Shaikh

    Hi,

    I want to upload .gifv file extension image. For that I have added the following code in functtions.php file.

    function my_myme_types($mime_types){
    $mime_types[‘gifv’] = ‘image/gifv’;
    return $mime_types;
    }
    add_filter(‘mime_types’, ‘my_myme_types’, 1, 1);

    File is uploaded successfully but its not playing. Please help.

  18. Dustin

    Doing this example I was able to now allow upload of AI file with custom Icon for the file type. I would like to change the icon used for PDF to a PDF icon. Can this be done?

    Seems like it just wants to use the default

  19. Amit Saxena

    hi,

    i m facing same issue still, i added apk extention from function file.
    but it shows still same issue.

    kindly suggest.

  20. Diana

    Thanks for this article, I used it today! I have a question. I had to allow .sql file types to be uploaded to wordpress, in order to upload some of my scripts that I would like to share.
    The problem is, if I put the script in a link, when I click on the link, the script downloads automatically, instead of opening in a new window.
    This is the code I added:
    function my_myme_types($mime_types){
    $mime_types[‘sql’] = ‘text/x-sql’; //Adding sql extension
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);
    When can I change the behavior? Also after the file is uploaded it says it is SQL type.

    Thanks
    Diana

  21. Darren

    So, it would be nice if we knew where to add the code??????????????????
    Thanks

      • Kevin

        At the bottom of the functions.php page. At the top? Is there already a place I add them to, like under the allowed file types already there? (jpg,gif,mp4,etc…)

        I’ll try at the bottom and see what happens.

        • Kevin

          Worked. For the people wondering. I just scrolled to the end of that page and pasted the code in there. If you copied and pasted the code up there, don’t be like me and leave the numbers. Just erase the numbers.

          And if you’re like me, you just skimmed through to find what you’re looking for. I couldn’t find what I had to put so it would open the right program, it’s in that link that’s hidden between the snippets of code up there. “File extensions” is what you’re looking for. Go to that page and look up your extension you want to add, I wanted to add KML and KMZ for my wiki on a stick and it looks like this…

          function my_myme_types($mime_types){
          $mime_types[‘kml’] = ‘application/vnd.google-earth.kml+xml’; //Adding kml extension
          $mime_types[‘kmz’] = ‘application/vnd.google-earth.kmz’; //Adding kmz files
          return $mime_types;
          }
          add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

          All I did was copy and past the code up there and changed the file extension and the… other part. Worked like a charm.

          Oh, the finctions.php is in appearance -> Editor -> On the right side of that page, Theme Functions (functions.php). Just scroll to the end of that page and add your code there.

        • Bruno

          Kevin, whats your WP version? Mine is 4.2.4 and it doesnt work!…

  22. Jeremy Taylor

    Adding the code looks pretty easy but it is not clear where I should add the code. Where do I go from my dashboard to add it? I’m using Wordpress 4.3.1.
    Thanks

    Jeremy

    • Kymmie

      Go to Appearance > Editor > Look for functions.php and just add the code to the bottom. Don’t forget to put a label like

      //Adding different file format

      so you would know.

  23. Bry

    Hi There.
    Thanks for the really useful information…
    I managed to get the different file types (.IES and .LDT files) to upload ok following your advise above but unfortunately they do not download as files, but rather as code….any tips on how to fix this issue?.
    Thanks in advance for your help.
    Regards
    Bry

    • Bry

      This is the code i used in the theme-function.php file..

      function my_myme_types($mime_types){
      $mime_types[‘ies’] = ‘application/octet-stream’; //Adding .ies extension
      $mime_types[‘ldt’] = ‘application/octet-stream’; //Adding .ldt extension
      return $mime_types;
      }
      add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

  24. Sara

    THX. That’s useful

  25. Mark Gandy

    How do you get the file type’s small icon (the file type logo) to load automatically where it will be positioned next to the name of the file (which is a link)? I’m guessing that’s CSS?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.