WordPress Snippets at WPcustoms

Disable auto creating of image sizes

WordPress creates by default 3 sizes for every image which is uploaded to the media library. This snippet unsets these sizes so only the original size is left on the server.


/**
 * Snippet Name: Disable auto creating of image sizes
 * Snippet URL: http://www.wpcustoms.net/snippets/disable-auto-creating-image-sizes/
 */
 function wpc_unset_imagesizes($sizes){
    unset( $sizes['thumbnail']);
    unset( $sizes['medium']);
    unset( $sizes['large']);
}
add_filter('intermediate_image_sizes_advanced', 'wpc_unset_imagesizes' );