{"id":51140,"date":"2015-07-27T08:46:22","date_gmt":"2015-07-27T12:46:22","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=51140"},"modified":"2017-08-01T05:20:43","modified_gmt":"2017-08-01T09:20:43","slug":"wordpress-add-additional-allowed-file-types-uploaded","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/wordpress-add-additional-allowed-file-types-uploaded.html","title":{"rendered":"WordPress. How to add additional allowed file types to be uploaded"},"content":{"rendered":"<p>\r\n<p>This video tutorial is going to show how to add additional file types to be uploaded in  <strong> WordPress<\/strong>.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=_5D_Dbrt4b4?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to add additional allowed file types to be uploaded<\/a><\/p>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-3-(835-x100).jpg\" \/>\r\n<\/a>\r\n<\/div>\r\n<ol>\r\n<li>\r\n<p>Log into WordPress admin panel, then go to <strong>Media<\/strong> -> <strong> Add New <\/strong> and try to upload audio\/ac3, video\/x-flv or image\/svg+xml file types: <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1-300x164.png\" alt=\"WordPress-How to add additional file types to be uploaded-1\" width=\"300\" height=\"164\" class=\"aligncenter size-medium wp-image-49071\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1-300x164.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1-150x82.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1-1024x561.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-1.png 1262w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <\/li>\r\n<li>\r\n<p>When uploading is done, you will get a message &#8216;Has failed to upload due to an Error. Sorry this file type is not permitted for security reasons&#8217;: <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2-300x167.png\" alt=\"WordPress-How to add additional file types to be uploaded-2\" width=\"300\" height=\"167\" class=\"aligncenter size-medium wp-image-49072\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2-300x167.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2-150x84.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2-1024x572.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-2.png 1254w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <\/li>\r\n<li>\r\n<p> To fix that, navigate to <strong>Appearance -> Editor<\/strong>, open <strong>custom-function.php<\/strong> file: <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3-300x166.png\" alt=\"WordPress-How to add additional file types to be uploaded-3\" width=\"300\" height=\"166\" class=\"aligncenter size-medium wp-image-49073\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3-300x166.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3-150x83.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3-1024x568.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-3.png 1266w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <\/li>\r\n<li>\r\n<p> Add the following function into the bottom of your custom-functions.php file to allow WordPress uploading additional mime types. <\/p>\r\n<pre class=\"brush:php\">\r\n  add_filter('upload_mimes','add_custom_mime_types');\r\n\tfunction add_custom_mime_types($mimes){\r\n\t\treturn array_merge($mimes,array (\r\n            'svg' => 'image\/svg+xml'\r\n\t\t));\r\n\t}  \r\n  <\/pre>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4-300x161.png\" alt=\"WordPress-How to add additional file types to be uploaded-4\" width=\"300\" height=\"161\" class=\"aligncenter size-medium wp-image-49074\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4-300x161.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4-150x80.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4-1024x549.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-4.png 1260w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p class=\"attention\">Notice that the file extension goes as the key in $mime_types associated array and the mime type goes as its value.<\/p>\r\n<p>In this example, svg file extension represents files with the mime type image\/svg+xml.<\/p>\r\n<p class=\"info-box\">You can find out mime types of several common file extensions on this page. <\/p>\r\n<\/li>\r\n<li>\r\n<p> Go back to Media Library and try to upload image\/svg file again: <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5-300x116.png\" alt=\"WordPress-How to add additional file types to be uploaded-5\" width=\"300\" height=\"116\" class=\"aligncenter size-medium wp-image-49075\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5-300x116.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5-150x58.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5-1024x396.png 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/06\/WordPress-How-to-add-additional-file-types-to-be-uploaded-5.png 1268w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <\/li>\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=_5D_Dbrt4b4?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to add additional allowed file types to be uploaded<\/a><\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This video tutorial is going to show how to add additional file types to be uploaded in  WordPress.<\/p>\n","protected":false},"author":73,"featured_media":49078,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[728],"tags":[1988,918,1159,546,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/51140"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=51140"}],"version-history":[{"count":2,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/51140\/revisions"}],"predecessor-version":[{"id":82387,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/51140\/revisions\/82387"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/49078"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=51140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=51140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=51140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}