Last modified by WP App Studio - 3 years ago
26 Views
Less than a minute read

How can I upload files to WordPress with non standard extension?

WordPress does not allow uploading files with non standard extensions. To be able to upload files without getting warning from WordPress, you need to apply upload_mimes filter and add it to your functions.php file of your theme. In the example below, we add files with .wpas extension to the allowed file list:

add_filter('upload_mimes', 'my_upload_types');
function my_upload_types($existing_mimes=array()){
$existing_mimes['wpas'] = 'wpas';
return $existing_mimes;
}
view raw gistfile1.txt hosted with ❤ by GitHub
Was this information helpful?