Fix WordPress Error: Sorry, This File Type Is Not Permitted For Security Reasons

Read this article with the solution to fix WordPress error getting the “Sorry, this file type is not permitted for security reasons” message

By Claudio Pires
Updated on June 14, 2023
Fix WordPress Error: Sorry, This File Type Is Not Permitted For Security Reasons

When you encounter the error message “Sorry, this type of file is not allowed for security reasons” in WordPress, it means that the type of file you are trying to upload is not allowed by default. For security reasons, WordPress restricts the file types you can upload through the WordPress admin panel. Read this article with the solution to fix WordPress when getting the “Sorry, this file type is not permitted for security reasons” error.

WordPress shows this error “Sorry, this file type is not permitted for security reasons” when you try to upload files to your website through the admin dashboard. Allowed file types include all common audio, video, document, and image formats. You get the error message if you try to upload any other file types.

Correct Spelling Of File Type Extension

If you’re trying to upload a common file type you previously uploaded without seeing this error, you’ve probably mistyped the file extension. A file extension is the 3 or 4-letter file type suffix that appears at the end of file names on your computer.

For example, an image file named hellophoto.png, where hellophoto is the file name and png is the extension. Extensions used to recognize file types.

When you get this error, “Sorry, this file type is not permitted for security reasons,” we recommend checking the file extension to ensure it’s correct. Sometimes when you edit or save a file on your computer, you may accidentally remove the file name extension. Or it could also be a typing error.

Now that you can see the file name extension, find the file you tried to upload and ensure it has the correct extension. So, if the extension is wrong, right-click on it and select the ‘Rename’ option. This function will rename the file and add the correct extension.

File Not Permitted Fix Using WordPress Plugins

Several plugins allow you to upload prohibited file types, such as File Manager. The settings of these plug-ins allow you to add MIME types, which allow you to upload in WordPress.

MIME types describe the content of a file and tell your browser how to display it correctly. For example, the file extension .jpg corresponds to the MIME type image/jpeg, displayed as an image in a web browser. We use the Enhanced Media Library plugin to add new MIME types for uploads. You can quickly install and activate plugins in the plugins section of WordPress: when I activate the plugin, we go to our settings and see that there is an option “MIME Types > Media”:

There are two ways to allow uploads of specific MIME types. The first step is to check the box corresponding to the desired MIME type in the “Allow Upload” column. However, if you cannot find the type you need in the list, select the “Add a new MIME type” option at the top of the page.

This will add a new line where you can enter the extension, mime type, and tag. Then check the Allow Uploads checkbox for the new MIME type. If you change your mind, you can use the button at the end of each line to remove the entry or select “Restore WordPress default MIME types” as the original setting.

Multisite Fix

You can fix this security issue very easily if you are using WordPress Multisite.

  • Under “Upload File Types,” you can add the files you want to upload.
  • Option in WordPress Multisite settings in the network admin area.
  • Please navigate to Network Admin Area > Settings > Upload Settings and add the necessary file types.
  • Make sure you separate the files with a space, not a comma.

Manual Modification Of wp-config.php

Access your WordPress site’s files through FTP or cPanel.

  • Locate the wp-config.php file in the root directory of your WordPress installation.
  • Add the following line of code above the “/* That’s all, stop editing! */” comment: define('ALLOW_UNFILTERED_UPLOADS', true).
  • Save the changes and upload the modified wp-config.php file back to your server.

Final Words About WordPress File Not Permitted

After implementing one of these solutions, try uploading the file again. But exercise caution when uploading potentially harmful file types to avoid security risks. We hope this article with the solution to fix WordPress when getting the error “Sorry, this type of file is not permitted ed for security reasons” has helped you! Please leave us a comment in the comment box below.

Claudio Pires

Claudio Pires is the co-founder of Visualmodo, a renowned company in web development and design. With over 15 years of experience, Claudio has honed his skills in content creation, web development support, and senior web designer. A trilingual expert fluent in English, Portuguese, and Spanish, he brings a global perspective to his work. Beyond his professional endeavors, Claudio is an active YouTuber, sharing his insights and expertise with a broader audience. Based in Brazil, Claudio continues to push the boundaries of web design and digital content, making him a pivotal figure in the industry.