Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Modify mime type in wordpress
* Modify wordpress mime types
* @param array $existing_mimes current mimes
function modify_mime_type($existing_mimes){
return array_merge($existing_mimes, array(
'7z' => 'application/x-7z-compressed',
'rar' => 'package/rar',
'tar' => 'package/x-tar',
'tgz' => 'application/x-tar-gz',
'apk' => 'application/',
'pkpass' => 'application/',
'zip' => 'package/zip',
'gz|gzip' => 'package/x-gzip')
return $existing_mimes;
// Add new mime type
add_filter( 'upload_mimes', 'modify_mime_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.