Last modified by MammaMia - 7 months ago
311 Views
1 min read

Why can I not upload certain file types to my WordPress site?

Our plugins come with fully customizable image or file upload field settings page. Each upload field can be configured separately to support your unique business requirements. The following can be set for each file or image upload field:

  • The maximum number of files that can be uploaded
  • The file types allowed
  • The maximum file size allowed

If you configured your field correctly based on your needs and still cannot upload certain types, the issue could be related to your WordPress configuration.

The following file types are allowed by WordPress.

  • Images: .jpg, .jpeg, .png, .gif, .ico,
  • Documents: .pdf (Portable Document Format; Adobe Acrobat), .doc, .docx (Microsoft Word Document), .ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation), .odt (OpenDocument Text Document), .xls, .xlsx (Microsoft Excel Document), .psd (Adobe Photoshop Document)
  • Audio: .mp3, .m4a, .ogg, .wav
  • Video: .mp4, .m4v (MPEG-4), .mov (QuickTime), .wmv (Windows Media Video), .avi, .mpg, .ogv (Ogg), .3gp (3GPP), .3g2 (3GPP2)

Please note that not all hosting services allow all the file types listed above. Some may block one or more types. In addition, there may be restrictions on the maximum uploadable file size. If you have issues with your file uploads, we recommend checking with your hosting provider first.

If your file type is not supported by WordPress or you do not want to allow certain types by default, you can add or remove an allowed file type. Simply modify the following script and add it to your theme's functions.php:

function uploadable_file_types( $mimes ) {
// New allowed mime types.
$mimes['svg'] = 'image/svg+xml';
$mimes['svgz'] = 'image/svg+xml';
$mimes['doc'] = 'application/msword';
// Optional. Remove a mime type.
unset( $mimes['exe'] );
return $mimes;
}
add_filter( 'upload_mimes', 'uploadable_file_types' );

Related Embeds
Related Articles
Previous Next
Was this information helpful?