The error message “Sorry, This File Type Is Not Permitted for Security Reasons” in WordPress is a security measure designed to protect your site from potential security risks. By default, WordPress only allows certain file types to be uploaded to the website for security reasons. If you are trying to upload a file that is not on the list of allowed file types, you may see this error message.
To resolve this issue and allow the upload of the specific file type, you can add the file type to the list of allowed file types in WordPress. Here are the steps to do this:
- Log in to your WordPress site and go to the “Functions.php” file of your WordPress theme. You can find this file in the “Appearance” section of the WordPress dashboard.
- Add the following code to the “Functions.php” file:
phpCopy codefunction custom_upload_mimes ( $existing_mimes=array() ) {
$existing_mimes['extension/type'] = 'mime/type';
return $existing_mimes;
}
add_filter('upload_mimes', 'custom_upload_mimes');
Replace ‘extension/type’ with the extension and file type that you want to allow, and ‘mime/type’ with the corresponding MIME type of the file.
- Save the changes to the “Functions.php” file and try to upload the file again.
Alternatively, you can also install a plugin like “WP Add Mime Types” to add new MIME types to the list of allowed file types in WordPress.
Note that allowing new file types to be uploaded to your website can potentially increase the security risk. It is important to ensure that the file types you allow are safe and do not contain any malicious code.