1. Home
  2. Applications Management
  3. WordPress
  4. How to Fix “Sorry, This File Type Is Not Permitted for Security Reasons” Error in WordPress

How to Fix “Sorry, This File Type Is Not Permitted for Security Reasons” Error in WordPress

Have you ever tried to upload a file to your WordPress Media Library and received an error: “Sorry, this file type is not permitted for security reasons” or “filename has failed to upload”?

If you didn’t know, WordPress limits the types of files you can upload to your site for security reasons. However, by adding some code to your wp-config.php file, or using a free plugin, you can expand the list of file types allowed so that you’re able to upload any type of file without a problem.

In this Knowledgebase Article, we’ll cover how to do this using by editing your wp-config.php file and how to do this via a plugin.

What Causes the “Sorry, this file type is not permitted for security reasons” Message?

The default WordPress configuration limits the file types you can upload to your site for security reasons.

You’ll receive the “Sorry, this file type is not permitted for security reasons” error when you try to upload a file type that’s not supported by the default configuration.

WordPress limits you to uploading only media file types, like documents, audio, images, and video, for security reasons.

By default, the safe files you can upload are:

Images:

  • .jpg
  • .jpeg
  • .png
  • .gif
  • .ico

Videos:

  • .mp4
  • .m4v
  • .mov
  • .wmv
  • .avi
  • .mpg
  • .ogv
  • .3gp
  • .3g2

Documents:

  • .pdf
  • .doc
  • .ppt, .pptx, .pps, .ppsx
  • .odt
  • .xls, .xlsx
  • .psd

Audio

  • .mp3
  • .m4a
  • .ogg
  • .wav

If you try to upload a file that isn’t supported, you’ll receive an error stating, Sorry, this file type is not permitted for security reasons.

How to Fix the “Sorry, this file type is not permitted for security reasons” Error in WordPress

Let’s look at two ways to fix this problem:

Add New Permitted File Types Using your wp-config.php File

Step 1: Login to your cPanel. There’s a lot of ways to do this, but the sure fire easiest way is to login to your Client Area, then open your cPanel.

Step 2: Open you File Manager from cPanel > Files.

Step 3: Navigate to the directory in which your WordPress installation is located and look for your wp-config.php file.

Step 4: Click Edit from the row of options at the top of the File Manager. A new tab will open with the code making up the wp-config.php file.

Scroll down to the bottom of the file and look for this section:

/* That’s all, stop editing! Happy publishing. */

Right before that line, add in this code:

define('ALLOW_UNFILTERED_UPLOADS', true);

Click Save Changes in the top left corner to save your changes.

Now, try to upload the file that failed originally and you should be good to go!

Use the free WP Extra File Types Plugin

Step 1: Open your /wp-admin and click Plugins > Add New from the left side.

Step 2: Use the search in the top right corner to search for the plugin WP Extra File Types.

Click install now to download the plugin, then click Activate.

Step 3: Once the plugin is activated, hover over the Settings tab, then click Extra File Types:

Step 4: Check the file types you want to be able to upload, then be sure to scroll all the way down to the bottom of the page and click Save Changes.

Now try to upload your files again and you should be good to go!

Questions? Comments? Leave us a note in the comments area below!

Updated on May 6, 2021

Was this article helpful?

Related Articles

Need help?
We're always here for you. Submit a ticket or Chat with a live person.
Submit Ticket

Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.