Restrict Certain File Mime Types in WordPress

Download FREE Marketing Guides

I recently heard from a client saying their blog was loading very slowly. The issue was caused from a high resolution image in .tiff format which is generally used for print. In order to block these file types add the following plugin to your mu-plugins folder.


/* prevent uploading of .tif files.
Full list of mime types

add_filter( 'upload_mimes', 'theme_restrict_mime_types' );
function theme_restrict_mime_types( $mime_types )
    $mime_types = array(
        'pdf' => 'application/pdf',
        'doc|docx' => 'application/msword',
        'jpg|jpeg' => 'image/jpeg',
        'gif' => 'image/gif',
        'png' => 'image/png'
    return $mime_types;

save as restrict-upload-types.php and upload to your mu-plugins folder.

Written by: Jake Lett
I share digital marketing tips and HubSpot tutorials to help marketers and business owners grow their business.

Related posts


Want to Get Email Updates of New Articles?

Join My Email Newsletter