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'm looking for a way to chose what images sizes get generated by image. With all the image sizes I have plus a lot of images, in the end I have a whole lot of server space being used up for nothing.

Is there a way to either?

  • at upload, select what image sizes get generated for a specific image
  • after upload, go to the media page and check off certain image sizes
share|improve this question
add comment

2 Answers 2

Picking which image sizes to generate on a per-upload basis is definitely going to be a bit involved. However, if you're okay with just entirely removing default image sizes, you have a couple of options, as described in this article:

The simplest way is to set the default image height and width to '0' at Settings > Media

The only problem with that solution is that those sizes will still appear in the wordpress media uploader.

To prevent those sizes from being generated and remove them from the media uploader, you can place the following code in your functions.php file (also grabbed from the article, I haven't tested this code.): UPDATE: I tested this code in WP 3.5.1 and it works perfectly

/**
 * Remove standard image sizes so that these sizes are not
 * created during the Media Upload process
 *
 * Tested with WP 3.2.1
 *
 * Hooked to intermediate_image_sizes_advanced filter
 * See wp_generate_attachment_metadata( $attachment_id, $file ) in wp-admin/includes/image.php
 *
 * @param $sizes, array of default and added image sizes
 * @return $sizes, modified array of image sizes
 * @author Ade Walker http://www.studiograsshopper.ch
 */
 function sgr_filter_image_sizes( $sizes) {

unset( $sizes['thumbnail']);
unset( $sizes['medium']);
unset( $sizes['large']);

return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'sgr_filter_image_sizes');
share|improve this answer
add comment

First of all you can remove some unused image sizes.

If it doesn't help (most times it wont, because you can use all of the sizes, just in different places), you can use this plugin: http://wordpress.org/plugins/dynamic-image-resizer/

It will change default WordPress behavior, and WordPress will generate thumbnail only if it is needed.

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.