Adding CBZ format to WordPress

On a SEO company website I look after we wanted to add a store for digital downloads, and one of the formats offered would be CBZ, a standard format for unencrypted and DRM free digital comic books. Turns out you need to add that file type to WordPress before you can upload them to the media library.

Finding an online solution to adding new file types to WordPress was easy, but the MIME type was required. That proved a little more complicated but internet searching led to this great site about MIME types, and another search led to a listing for CBZ.

I added this to functions.php and everything was working.

// Added to extend allowed files types in Media upload
add_filter(‘upload_mimes’, ‘custom_upload_mimes’);
function custom_upload_mimes ( $existing_mimes=array() ) {

// Add *.CBZ files to Media upload
$existing_mimes[‘cbz’] = ‘application/x-cdisplay’;

return $existing_mimes;
}