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.

I've been looking around the net for a long time on how to disable WordPress from creating multiple thumbnails.

I've seen in most tutorials to set all the images to 0 in the media section. I have done that, but going to my uploads folder and it still creates multiple images.

I can't find any solution for this. The reason I want this is to save space on my host account.

share|improve this question
    
Please turn off any plugins and switch to your default theme. Then you should be able to set all image sizes to 0 and keep WP from generating those sizes. If this doesn't work, please report back. If it works, then there's some plugin or theme interfering. –  kaiser Mar 17 '13 at 11:33

5 Answers 5

To built on Max Yudin's answer you should use the intermediate_image_sizes_advanced filter, and not image_size_names_choose.

function add_image_insert_override($sizes){
    unset( $sizes['thumbnail']);
    unset( $sizes['medium']);
    unset( $sizes['large']);
}
add_filter('intermediate_image_sizes_advanced', 'add_image_insert_override' );

Another easier option I think works is going to your Settings-->Media and setting each box for width and height to 0

share|improve this answer
    
+1 for "Settings" > "Media". No need to filter anything when one can use the idea the UI is based upon. –  kaiser Mar 17 '13 at 11:32
1  
This doesn't work. Your function needs to return $sizes; –  Eek Aug 8 at 16:39

You can also filter intermediate_image_sizes with an empty array.

 add_filter( 'intermediate_image_sizes', '__return_empty_array' );
share|improve this answer

If I remember right you have to unset all the defaults and add the new Size there:

    <?php
function mxdCustomImageSizes($sizes) {
    unset( $sizes['thumbnail']);
    unset( $sizes['medium']);
    unset( $sizes['large']);
    unset( $sizes['full'] );

    $myimgsizes = array(
        'full-size' => __( 'Full Size' )
    );
    if( !empty($sizes) )
        return array_merge($sizes, $myimgsizes);
    else
        return $myimgsizes;
}
add_filter('intermediate_image_sizes_advanced', 'mxdCustomImageSizes');

And then add the full-size size which is 99999x99999 right below which size is almost unbelievable so is full size.

add_image_size( 'full-size', 99999, 99999, false );

Please correct me if something goes wrong

P. S. You'll need a plugin to "save as" all your images according to your new settings. I can recommend the Regenerate Thumbnails plugin.

P. P. S. When it's the single Option any way you'll have to choose one of one :). There no straight way to make one Size selected in the new (3.5.1) Media window.

share|improve this answer
    
Hi Max I think this is the wrong filter, image_size_names_choose is for the output when you select images in the media box. –  Wyck Mar 16 '13 at 16:15
    
Yes, you are right. Thank you for information, now I have to revise some stuff I've already made. –  Max Yudin Mar 17 '13 at 19:03

Visit the Settings > Media page of your WordPress dashboard. Under the Image Sizes section, change all of the values to 0.

Media Settimgs

Save the changes. This will stop WordPress generating thumbnails, medium, and large sizes of every image you upload.

You will also notice that when you go to insert an image, the "Size" dropdown box is missing.

share|improve this answer
    
This does not work! –  Pazis Sep 11 at 13:07
    
@Pazis It worked in an older version of WordPress, but doesn't seem to work in 4.0 –  bungeshea_ Sep 12 at 6:15
function remove_default_image_sizes( $sizes) {
    unset($sizes['thumbnail']);
    unset($sizes['medium']);
    unset($sizes['large']);
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced','remove_default_image_sizes');

Don't forget to return $sizes; like this.

Then add new image sizes like...

if(function_exists('add_image_size')){
    add_image_size('my_100x100_crop',100,100,true); // Crop mode
    add_image_size('my_100x100_resize',100,100); // Resize mode
}

Tested!

share|improve this answer
    
This removes the sizes from "Insert to post", but Wordpress still generates the thumbnails! –  Pazis Sep 11 at 13:05

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.