Skip to main content
All CollectionsTroubleshooting and FAQsCommon Issues
How to Fix the "Sorry, you are not allowed to upload this file type" Error
How to Fix the "Sorry, you are not allowed to upload this file type" Error

Learn how to fix the “Sorry, you are not allowed to upload this file type” error in WordPress to successfully upload your desired files.

Updated over a week ago

Encountering the "Sorry, you are not allowed to upload this file type" error can be frustrating, especially when you need to add specific files to your WordPress site.

This article will help you understand why this error occurs and provide you with effective solutions to resolve it.

Important Note: Please be aware that allowing such files to be uploaded may cause security issues, so we don't recommend you do this if you don't really need to.

The error Sorry, you are not allowed to upload this file type is usually displayed when custom font files are being added and it is not related to Divi.

Sorry, you are not allowed to upload this file type

The error comes from WordPress, which forbids certain files to be uploaded for security reasons.

You can find a full list of permitted files on the WordPress Documentation page.

Fixing the "Sorry, you are not allowed to upload this file type" error using plugins

You can use any of the following plugins to bypass the error:

  1. Easy SVG Support (though this plugin is related to SVG, it should allow you to upload files that are not possible to upload due to security reasons)

Fixing the "Sorry, you are not allowed to upload this file type" error using the upload_mimes WordPress filter hooks

Before proceeding further with this method, it is important to know what file type you are trying to upload.

For example, if you are trying to upload a .csv file, this is a text/csv type. With that out of the way, you can use either a Child Theme for Divi or you can use the Code Snippets plugin to add the following PHP code:

function my_custom_upload_mimes($mimes = array()) {
$mimes['csv'] = "text/csv";
return $mimes;
}
add_action('upload_mimes', 'my_custom_upload_mimes');

Fixing the "Sorry, you are not allowed to upload this file type" error by modifying the wp-config.php file

  1. Install and activate the Advanced File Manager plugin

  2. Use the plugin and edit the wp-config.php file

  3. After this PHP line:

    $table_prefix = 'wp_';

    Add the following line:

    define('ALLOW_UNFILTERED_UPLOADS', true);

  4. Save the changes

  5. Upload the file again.

Important note: After the file(s) is/are uploaded, remove that line of PHP code from your wp-config.php file.

Edge cases

If none of the above works, contact your hosting support team. They will have to manually allow the file types you are trying to upload from the server's end.

If you are looking for better hosting, we recommend Divi Hosting. It is optimized and configured to ensure that any Divi site runs smoothly. In addition to that, the Divi theme will be preinstalled for you.

Did this answer your question?