Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Tried setting the thumbnail size, but left medium + large to 0 0 to disable them, still all 3 were generated. Is there anyway to selectively disable these via functions.php?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can disable the medium and large image sizes by using the 'intermediate_image_sizes' filter:

function remove_image_sizes($image_sizes){
    foreach($image_sizes as $key => $size){
        if($size == 'large' || $size == 'medium')
            unset($image_sizes[$key]);
    }
    return $image_sizes;
}
add_filter('intermediate_image_sizes', 'remove_image_sizes', 12, 1);

This skips adding these sizes and the options to insert a medium/large image are left blank in the media item.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.