MIME Types in WordPress

MIME types determine what type of media a specific file type is. WordPress restricts both file types and MIME types, with additional types being added through code changes. In this article we explain what MIME types are, which MIME types WordPress allows to be uploaded, which MIME types WordPress recognizes, and how to add more MIME types if needed.


About MIME Types

MIME stands for Multipurpose Internet Mail Extensions. MIME types are used by browsers and other internet devices to determine the type of content associated with a page. For instance, if you have a .png file and a .jpeg file on the page, the browser would know by their MIME types to treat both files as images rather than videos or some other file types.

By default, WordPress has a list of registered mime types stored in wp-includes/functions.php that any developer can call using wp_get_allowed_mime_types(). These files are the file types recognized by WordPress.

By default, not all MIME types recognized are allowed to be uploaded through the WordPress Admin Dashboard. To see only the types that WordPress allows to be uploaded, you can use the upload_mimes filter.

If you attempt to upload a file not supported by WordPress, you may see an error such as:

Sorry, this file type is not permitted for security reasons.


Allowed WordPress MIME Types

Just because WordPress identifies a specific MIME type does not mean that the file type can be uploaded in your WordPress Admin Dashboard. WordPress restricts the file types that can be uploaded to the ones listed below.

Below is a list of the various file types supported by WordPress, and the MIME types of those file extensions.

File Extension

MIME Type

.jpgimage/jpeg, image/pjpeg
.jpegimage/jpeg, image/pjpeg
.pngimage/png
.gifimage/gif
.icoimage/x-icon
.pdfapplication/pdf
.docapplication/msword
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
.pptapplication/mspowerpoint, application/powerpoint, application/vnd.ms-powerpoint, application/x-mspowerpoint
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation
.ppsapplication/mspowerpoint, application/vnd.ms-powerpoint
.ppsxapplication/vnd.openxmlformats-officedocument.presentationml.slideshow
.odtapplication/vnd.oasis.opendocument.text
.xlsapplication/excel, application/vnd.ms-excel, application/x-excel, application/x-msexcel
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.psdapplication/octet-stream
.mp3audio/mpeg3, audio/x-mpeg-3, video/mpeg, video/x-mpeg
.m4aaudio/m4a
.oggaudio/ogg,
.wavaudio/wav, audio/x-wav
.mp4video/mp4
.m4vvideo/x-m4v
.movvideo/quicktime
.wmvvideo/x-ms-asf, video/x-ms-wmv
.aviapplication/x-troff-msvideo, video/avi, video/msvideo, video/x-msvideo
.mpgaudio/mpeg, video/mpeg
.ogvvideo/ogg
.3gpvideo/3gpp, audio/3gpp
.3g2video/3gpp2, audio/3gpp2


WordPress Recognized MIME Types

Using the wp_get_allowed_mime_types() function you can get a list of MIME types WordPress recognizes. Below we’ll go over the MIME types not allowed to be uploaded in the wp-admin, but that WordPress still recognizes.

File Extension

MIME Type

.bmpimage/bmp
.tifimage/tiff
.tiffimage/tiff
.asfvideo/x-ms-asf
.asxvideo/x-ms-asf
.wmvideo/x-ms-wm
.wmxvideo/x-ms-wmx
.divxvideo/divx
.flvvideo/x-flv
.qtvideo/quicktime
.mpevideo/mpeg
.webmvideo/webm
.mkvvideo/x-matroska
.txttext/plain
.asctext/plain
.ctext/plain
.cctext/plain
.htext/plain
.csvtext/csv
.tsvtext/tab-separated-values
.icstext/calendar
.rtxtext/richtext
.csstext/css
.htmtext/html
.htmltext/html
.m4baudio/mpeg
.raaudio/x-realaudio
.ramaudio/x-realaudio
.midaudio/midi
.midiaudio/midi
.waxaudio/x-ms-wax
.mkaaudio/x-matroska
.rtfapplication/rtf
.jsapplication/javascript
.swfapplication/x-shockwave-flash
.classapplication/java
.tarapplication/x-tar
.zipapplication/zip
.gzapplication/x-zip
.gzipapplication/x-zip
.rarapplication/rar
.7zapplication/x-7z-compressed
.exeapplication/x-msdownload
.potapplication/vnd.ms-powerpoint
.wriapplication/vnd.ms-write
.xlaapplication/vnd.ms-excel
.xltapplication/vnd.ms-excel
.xlwapplication/vnd.ms-excel
.mdbapplication/vnd.ms-access
.mppapplication/vnd.ms-project
.docmapplication/vnd.ms-word.document.macroEnabled.12
.dotxapplication/vnd.openxmlformats-officedocument.wordprocessingml.template
.dotmapplication/vnd.ms-word.template.macroEnabled.12
.xlsmapplication/vnd.ms-excel.sheet.macroEnabled.12
.xlsbapplication/vnd.ms-excel.sheet.binary.macroEnabled.12
.xltxapplication/vnd.openxmlformats-officedocument.spreadsheetml.template
.xltmapplication/vnd.ms-excel.template.macroEnabled.12
.xlamapplication/vnd.ms-excel.addin.macroEnabled.12
.pptmapplication/vnd.ms-powerpoint.presentation.macroEnabled.12
.ppsmapplication/vnd.ms-powerpoint.slideshow.macroEnabled.12
.potxapplication/vnd.openxmlformats-officedocument.presentationml.template
.potmapplication/vnd.ms-powerpoint.template.macroEnabled.12
.ppamapplication/vnd.ms-powerpoint.addin.macroEnabled.12
.sldxapplication/vnd.openxmlformats-officedocument.presentationml.slide
.sldmapplication/vnd.ms-powerpoint.slide.macroEnabled.12
.onetocapplication/onenote
.onetoc2application/onenote
.onetmpapplication/onenote
.onepkgapplication/onenote
.odpapplication/vnd.oasis.opendocument.presentation
.odsapplication/vnd.oasis.opendocument.spreadsheet
.odgapplication/vnd.oasis.opendocument.graphics
.odcapplication/vnd.oasis.opendocument.chart
.odbapplication/vnd.oasis.opendocument.database
.odfapplication/vnd.oasis.opendocument.formula
.wpapplication/wordperfect
.wpdapplication/wordperfect
.keyapplication/vnd.apple.keynote
.numbersapplication/vnd.apple.numbers
.pagesapplication/vnd.apple.pages


Additional File Types

If you need to use other file types with WordPress beyond what it identifies already, it’s often simplest to use a plugin to extend this function. This is most often necessary with file types that are not images. Common examples include .epub or .mobi files from eBooks.

If you need a reference of which MIME types are available web-wide to add, see this comprehensive list.

If you’re still having issues, another potential solution is to add the following to your wp-config.php file. This allows uploading of non-image file types for administrator level users only.

define( 'ALLOW_UNFILTERED_UPLOADS', true );

Non-Image File Upload Error

In the security patch for WordPress 4.7.1 which was released in January 2017, a change to the way WordPress checks the file “MIME type” for uploads was made, which may cause an error on uploads for some file types (specifically non-image files).

Some users, especially those using custom plugins to add additional file types to the ones WordPress allows by default found here may experience an error when uploading:

“filename” has failed to upload.
Sorry, this file type is not permitted for security reasons.

There are a couple ways to fix this error:

NOTE: Do NOT downgrade WordPress to fix this issue. Security patches for earlier versions of WordPress also contain this change. Downgrading will only weaken your site’s security and will not correct the error.


NEXT STEP: Using WebP for image optimization

Still need help? Contact support!

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best in WordPress hosting.

See why more customers prefer WP Engine over the competition.