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:
- .ppt, .pptx, .pps, .ppsx
- .xls, .xlsx
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.
Struggling with WordPress troubleshooting? ChemiCloud is the hosting solution designed to save you time! 🤓 Check out our WordPress Hosting plans!
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
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
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:
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!