Do y'all want to allow additional file types to be uploaded to your forms? Allowing more than file formats to exist uploaded to your site can provide more convenience for you and your users.

In this tutorial, nosotros'll testify you lot how to add together different file extensions, without compromising the security of your site.

  • File Types Immune By Default
  • Adding Additional File Upload Types
    • Using Preset File Types
    • Calculation Custom File Types
    • Allowing Multiple MIME Types
  • Tips for Securing WordPress File Uploads
  • Frequently Asked Questions

Note: Are you looking for instructions on creating a file upload form? And then be certain to bank check out our guide to the File Upload field for all the details.


File Types Allowed By Default

For security reasons, WordPress merely allows certain types of files. The default file formats include:

  • Images like .png, .gif, .jpg
  • Documents such as .doc, .xls, .ppt, .pdf
  • Audio like .wav, .mp3, .mp4
  • Video like .mpg, .mov, .wmv

Please note that some of the file types below do accept the potential to exist misused. That's why WordPress doesn't enable them by default.

  • Images such equally .svg, .bmp
  • Documentslike .psd, .ai, .pages
  • Code files such as .css, .js, .json
  • Video similar .flv, .f4l, .qt

Adding Additional File Upload Types

To configure your site to take additional file formats, you lot'll need to install File Upload Types, a free WordPress plugin past WPForms.

Note: For details on how to add a plugin to your site, exist sure to check out WPBeginner'due south guide on installing plugins.

Using Preset File Types

Once you've installed the File Upload Types plugin, in your WordPress admin area become to Settings » File Upload Types.

File upload types page

On this folio, you can add preset file types past checking the box side by side to the file type.

Enable extension checkbox

One time you've selected the file types you'd similar to add, click the Save Settings button to salvage your changes.

Click save settings button preset file

Calculation Custom File Types

If you'd like to include a file format that is non establish in the preset list, yous can add your own.

To practice this, roll downward to the ADD CUSTOM FILE TYPES section. Then, you'll need to specify a file format. This is done through 3 fields:

  • File Clarification: The name of the file type. This will only be visible in your File Upload Types settings, so you can add together whatever details that make sense to y'all.
  • MIME Type: The category and information type represented by the new file type.
  • Extension: The extension blazon that volition exist associated with this file (e.one thousand., .jpg, .docx, etc.).

Note: MIME is a form of file identification on the web. For more than details on MIME, yous can check out Mozilla'south documentation for a complete list of mutual MIME types. To determine what MIME blazon a file is, you can employ an online file checker.

Add custom file types section

As an example, hither are the fields with the information for a YAML file type:

YAML file extension

Yous can besides add multiple custom file types by clicking on the plus (+) icon. If you'd like to remove a file type, click the trash can icon.

Plus and trash icons

One time you've filled in all these details, click on the Salvage Settings button to utilize the settings to your site.

Click save settings button

Assuasive Multiple MIME Types

If you're calculation a file type that has several aliases or possible MIME types, y'all can also add these into the MIME Types field. This is peculiarly helpful to ensure the proper uploading of files that may have the same extension, but different MIME types.

Note: If you're not sure if your file type has aliases, yous can check out this reference guide for a partial list.

In guild to use this feature, you'll demand to click the Enable multiple MIME type support pick within the plugin.

Enable multiple MIME type support

Note: If you don't see this banner in your plugin, this means this option is already enabled on your site.

One time you've enabled this feature, y'all can then add aliases to the MIME Type field, separating each type by a comma.

For case, we'll add the application/photoshop, application/psd, and image/photoshop aliases for a Photoshop file:

Photoshop file example

One time those settings are added, brand sure to click the Save Settings button to use the settings to your site.

Click save settings photoshop file example

Tips for Securing WordPress File Uploads

It may exist user-friendly to allow users to upload all sorts of file formats, still, this tin lead to security issues. You can keep your site more secure while allowing for specific upload types by following these tips:

  • Requiring users to be registered and logged in to submit your form.
  • Limiting file upload types to simply those that you lot really demand.
  • Limiting the file upload size.

Frequently Asked Questions

I added my additional file type, but I'm still seeing the post-obit mistake:

File type not allowed

In this case, you lot'll desire to be sure that the file you're trying to upload has a MIME type that matches the one y'all've added to your site. You lot can speedily and hands check your file's MIME blazon to be sure its blazon matches.

If your MIME type matches and still won't upload, it's important to know that WPForms does blacklist certain file types. Some file types volition be blocked from being uploaded, even if they've been added using the File Upload Types plugin. The complete listing of file types are:

ade adp app asp
bas bat cer cgi
chm com cpl crt
csh csr dll drv
exe fxp flv hlp
hta htaccess htm html
htpasswd inf ins internet service provider
jar js jse jsp
ksh lnk mdb mde
mdt mdw msc msi
msp mst ops pcd
php pif pl prg
ps1 ps2 py rb
scr sct sh shb
shs swf tmp torrent
url vb vbe vbs
vbscript wsc wsf wsh
dfxp onetmp

That'due south it! Y'all tin now allow users to upload boosted file types using your file upload form.

Do yous want more tips for securing your site? Then be sure to check out our complete guide to WPForms security for all the details.