When uploading a file to your WordPress Media Library, or importing a simple file extension like .csv, you might encounter the "Sorry, you are not allowed to upload this file type." error. The message appears when you try to upload a file with an extension other than what WordPress allows by default. The default file types allowed are:
Images: .jpeg, .jpg, .png, .gif, .ico
Documents: .pdf, .doc, .docx, .ppt, .pptx, .pps, .ppsx, .odt, .xls, .xlsx, .psd
Audio: .mp3, .m4a, .ogg, .wav
Video: .mp4, .m4v, .mov, .wmv, .avi, .mpg, .ogv, .3gp, .3g2
Trying to upload files with extensions other than those listed above will result in the "Sorry, you are not allowed to upload this file type." error.
To allow the upload, go to Site Tools > Site > File Manager and edit the wp-config.php file for your WordPress, which is usually found in the public_html folder. Above the line ‘That’s all, stop editing! Happy publishing.‘ insert the following:
Save the changes to the file, and you should be able to upload the desired file from your
WordPress Dashboard -> Media -> Add New
For security reasons, it is recommended to remove that new line you added in the wp-config.php file after you upload the desired files. If you later want to upload more, you can add the line again.
Instead of putting code directly into wp-config.php, you can use the following
Free plugin - WPCode: