How to Fix Error in WordPress, “Sorry You are Not Allowed to Upload this File Type”
When you try to upload a file to your WordPress Media Library, there is the possibility that you may get an error, “Sorry, you are not allowed to upload this file type.”
When you try to upload a file to your WordPress Media library, library, there are chances you will get the error.
In WordPress, the file types allowed are:
- Images Extension Supported: .jpeg, .jpg, .png, .gif, .ico
- Documents Extension Supported: .pdf, .psd, .xlsx, .odt, .ppsx, .pps, .pptx, .docx, .doc
- Audio Extension Supported: .mp3, .wav, .ogg
- Video Extension Supported: .webm, .flv, .mp4, .svi, .nsv
If you type extensions apart from this, then you will get an error message highlighting, “Sorry, you are not allowed to upload this file type.”
Method 1: Edit wp-config.php (Advanced)
To successfully upload, you have to follow these steps, Site Tools > Site > File Manager and thenedit the wp-config.php file for your WordPress site. It is located in the public html folder.
Now, above the line, “That’s all, stop editing! It’s time to publish the post. Type the command mentioned below:
define(‘ALLOW_UNFILTERED_UPLOADS’, true);
Now, save all the changes to your file and this will allow you to upload the desired file from your WordPress wp-admin > Media> Add New.
Method 2:
Double-Check the File Extension:
Sometimes the error appears even for allowed file types if the extension (like .jpg for jpeg images) is misspelled. Make sure the extension on your file matches the actual file type.
Change File Format (if applicable):
If the file type isn’t crucial, consider converting it to a format that WordPress allows. Like, you can convert a PNG image to a JPG.
Use a Plugin (for more control):
Plugins like “File Upload Types” let you add new file types to the list of allowed uploads in WordPress. This gives you more control over what can be uploaded but remember only to enable trusted file types.
Contact Hosting Provider (for Multisite or Server-side issues):
If you’re on a WordPress Multisite network, specific upload settings might be configured. Contact your hosting provider for assistance in such cases. They can also help diagnose if the issue lies with your server’s MIME type settings.
Wrapping Up
Remember, for security reasons, it’s suggested to remove that new line you have inserted in the wp-config,php after uploading the given files. This is important from a future point of view, as you need to upload more then you can insert the line again.