{"id":5391,"date":"2021-05-06T07:24:20","date_gmt":"2021-05-06T07:24:20","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=ht_kb&#038;p=5391"},"modified":"2024-10-16T09:24:02","modified_gmt":"2024-10-16T09:24:02","slug":"sorry-this-file-type-is-not-permitted-for-security-reasons","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/sorry-this-file-type-is-not-permitted-for-security-reasons\/","title":{"rendered":"How to Fix &#8220;Sorry, This File Type Is Not Permitted for Security Reasons&#8221; Error in WordPress"},"content":{"rendered":"<p>Have you ever tried to upload a file to your WordPress Media Library and received an error: &#8220;Sorry, this file type is not permitted for security reasons&#8221; or &#8220;filename has failed to upload&#8221;?<\/p>\n<p>If you didn&#8217;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&#8217;re able to upload any type of file without a problem.<\/p>\n<p>In this Knowledgebase Article, we&#8217;ll cover how to do this using by editing your wp-config.php file and how to do this via a plugin.<\/p>\n<h2 id=\"what-causes-the-sorry-this-file-type-is-not-permitted-for-security-reasons-message\">What Causes the \u201cSorry, this file type is not permitted for security reasons\u201d Message?<\/h2>\n<p>The default WordPress configuration limits the file types you can upload to your site for security reasons.<\/p>\n<p>You&#8217;ll receive the &#8220;Sorry, this file type is not permitted for security reasons&#8221; error when you try to upload a file type that&#8217;s not supported by the default configuration.<\/p>\n<p>WordPress limits you to uploading only media file types, like documents, audio, images, and video, for security reasons.<\/p>\n<p>By default, the safe files you can upload are:<\/p>\n<p>Images:<\/p>\n<ul>\n<li>.jpg<\/li>\n<li>.jpeg<\/li>\n<li>.png<\/li>\n<li>.gif<\/li>\n<li>.ico<\/li>\n<\/ul>\n<p>Videos:<\/p>\n<ul>\n<li>.mp4<\/li>\n<li>.m4v<\/li>\n<li>.mov<\/li>\n<li>.wmv<\/li>\n<li>.avi<\/li>\n<li>.mpg<\/li>\n<li>.ogv<\/li>\n<li>.3gp<\/li>\n<li>.3g2<\/li>\n<\/ul>\n<p>Documents:<\/p>\n<ul>\n<li>.pdf<\/li>\n<li>.doc<\/li>\n<li>.ppt, .pptx, .pps, .ppsx<\/li>\n<li>.odt<\/li>\n<li>.xls, .xlsx<\/li>\n<li>.psd<\/li>\n<\/ul>\n<p>Audio<\/p>\n<ul>\n<li>.mp3<\/li>\n<li>.m4a<\/li>\n<li>.ogg<\/li>\n<li>.wav<\/li>\n<\/ul>\n<p>If you try to upload a file that isn&#8217;t supported, you&#8217;ll receive an error stating, Sorry, this file type is not permitted for security reasons.<\/p>\n<p class=\"p1\"><strong>Struggling with WordPress troubleshooting? ChemiCloud is the hosting solution designed to save you time! <span class=\"s1\">\ud83e\udd13<\/span> Check out our <span class=\"s1\"><a href=\"https:\/\/chemicloud.com\/managed-wordpress-hosting?utm_source=blog&amp;utm_medium=article#60b65e4e63b58\">Managed WordPress hosting<\/a> <\/span>plans!<\/strong><\/p>\n<h2 id=\"how-to-fix-the-sorry-this-file-type-is-not-permitted-for-security-reasons-error-in-wordpress\">How to Fix the \u201cSorry, this file type is not permitted for security reasons\u201d Error in WordPress<\/h2>\n<p>Let&#8217;s look at two ways to fix this problem:<\/p>\n<h3 id=\"add-new-permitted-file-types-using-your-wp-config-php-file\">Add New Permitted File Types Using your wp-config.php File<\/h3>\n<p><strong>Step 1:<\/strong> Login to your cPanel. There&#8217;s a lot of ways to do this, but the sure fire easiest way is to login to your <a href=\"https:\/\/lab.chemicloud.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Client Area<\/a>, then open your cPanel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4061\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab.jpg\" alt=\"\" width=\"1674\" height=\"496\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab.jpg 1674w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-300x89.jpg 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-1024x303.jpg 1024w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-768x228.jpg 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-50x15.jpg 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-1536x455.jpg 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-60x18.jpg 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/12\/lab-100x30.jpg 100w\" sizes=\"auto, (max-width: 1674px) 100vw, 1674px\" \/><\/p>\n<p>Step 2: Open you File Manager from cPanel &gt; Files.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5392\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-783x218.png\" alt=\"\" width=\"643\" height=\"179\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-783x218.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-300x83.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-768x213.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-50x14.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-1536x427.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-60x17.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1-100x28.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/1.png 1897w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>Step 3: Navigate to the directory in which your WordPress installation is located and look for your <code>wp-config.php<\/code> file.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5393\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-783x530.png\" alt=\"\" width=\"643\" height=\"435\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-783x530.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-300x203.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-768x519.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-50x34.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-1536x1039.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-60x41.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2-100x68.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/2.png 1897w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>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 <code>wp-config.php<\/code> file.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5394\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-783x248.png\" alt=\"\" width=\"643\" height=\"204\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-783x248.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-300x95.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-768x244.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-50x16.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-1536x487.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-60x19.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3-100x32.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/3.png 1897w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>Scroll down to the bottom of the file and look for this section:<\/p>\n<pre>\/* That\u2019s all, stop editing! Happy publishing. *\/<\/pre>\n<p>Right before that line, add in this code:<\/p>\n<p><code>define('ALLOW_UNFILTERED_UPLOADS', true);<\/code><\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5395\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-783x130.png\" alt=\"\" width=\"643\" height=\"107\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-783x130.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-300x50.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-768x128.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-50x8.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-1536x255.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-60x10.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4-100x17.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/4.png 1897w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>Click Save Changes in the top left corner to save your changes.<\/p>\n<p>Now, try to upload the file that failed originally and you should be good to go!<\/p>\n<h3 id=\"use-the-free-wp-extra-file-types-plugin\">Use the free WP Extra File Types Plugin<\/h3>\n<p>Step 1: Open your \/wp-admin and click Plugins &gt; Add New from the left side.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5396\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5.png\" alt=\"\" width=\"554\" height=\"763\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5.png 554w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5-218x300.png 218w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5-36x50.png 36w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5-44x60.png 44w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/5-73x100.png 73w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><\/p>\n<p>Step 2: Use the search in the top right corner to search for the plugin WP Extra File Types.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5397\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-783x279.png\" alt=\"\" width=\"643\" height=\"229\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-783x279.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-300x107.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-768x274.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-50x18.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-1536x548.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-60x21.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6-100x36.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/6.png 1897w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>Click install now to download the plugin, then click Activate.<\/p>\n<p>Step 3: Once the plugin is activated, hover over the Settings tab, then click Extra File Types:<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5398\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-610x783.png\" alt=\"\" width=\"610\" height=\"783\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-610x783.png 610w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-234x300.png 234w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-39x50.png 39w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-47x60.png 47w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7-78x100.png 78w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/7.png 749w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>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.<\/p>\n<p><a href=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5399\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-684x783.png\" alt=\"\" width=\"643\" height=\"736\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-684x783.png 684w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-262x300.png 262w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-768x879.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-44x50.png 44w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-1342x1536.png 1342w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-1790x2048.png 1790w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-52x60.png 52w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9-87x100.png 87w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2021\/05\/9.png 1898w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>Now try to upload your files again and you should be good to go!<\/p>\n<p>Questions? Comments? Leave us a note in the comments area below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever tried to upload a file to your WordPress Media Library and received an error: &#8220;Sorry, this file type is not permitted for security reasons&#8221; or &#8220;filename has failed to upload&#8221;? If you didn&#8217;t know, WordPress limits the types of files you can upload to your site for&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[40],"ht-kb-tag":[],"class_list":["post-5391","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/5391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=5391"}],"version-history":[{"count":5,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/5391\/revisions"}],"predecessor-version":[{"id":8476,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/5391\/revisions\/8476"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=5391"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=5391"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=5391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}