Fix WordPress Issue “Sorry, this file type is not permitted for security reasons.” (eg: fonts)

Sometimes in WordPress site you try to upload file and got the error message “Sorry, this file type is not permitted for security reasons.” as shown in the following screenshots which results in not allowing you to upload that file.

This happens because by default WordPress allows users to upload only any of the following file types and if you try to upload any other file types then you get the error message “Sorry, this file type is not permitted for security reasons.”.

You can find a full list of permitted files here https://codex.wordpress.org/Uploading_Files

To allow file types to upload other than listed above, you can fix this issue using any of the following various ways.

Fix The Issue Using WordPress Plugins#

You can use any of the following plugins on your site and configure it to allow to upload file types on your site.

WP Add Mime Types

Mime Types Extended

Unsafe Mimetypes

Mime Types Plus

Manage Upload Types

Fix The Issue To Allow To Upload All File Types In File Upload#

You can set the WordPress constant ALLOW_UNFILTERED_UPLOADS to true that will allow you to upload all file types on your WordPress site.

To set ALLOW_UNFILTERED_UPLOADS constant to true just add the following line of code in the wp-config.php file of your WordPress install which you will find in the root directory of your WordPress setup.

define('ALLOW_UNFILTERED_UPLOADS', true);

You can add the above line of code in the wp-config.php file just above the following statement.

/* That's all, stop editing! Happy blogging. */

 

Fix The Issue Using WordPress Multisite Settings#

If you are using WordPress Multisite then you can add the file type that you want to upload in the “Upload file types” option of WordPress Multisite Upload Settings in network admin area on the following path as shown in the below screenshot.

Network Admin Area -> Settings -> Upload Settings eg:

Fix The Issue By Contacting Web Host#

If your issue doesn’t fix using any of the above solutions then this can be your web host issue as many hosts don’t support various types of files to upload on server due to security issue so you can contact your web host to resolve it.