File Type Not Permitted when Uploading Media

Last modified: August 19, 2024

Ask Your Favorite AI

Copy the link to a markdown format of this article for ChatGPT, Claude, Gemini, or your favorite AI.

If you are uploading files in the media library or within form elements on your WordPress site and receive this error:

Sorry, this file type is not permitted for security reasons.

The way to resolve this it to edit the wp-config.php file and copy/paste the below code snippet above the /* That’s all, stop editing! */ line:

define('ALLOW_UNFILTERED_UPLOADS', true);

Another option is the WP Extra File Types plugin, which allows you to control which file types can be uploaded.