Title: Custom Image Size Function
Last modified: August 21, 2016

---

# Custom Image Size Function

 *  [Ryan_Prejean](https://wordpress.org/support/users/ryan_prejean/)
 * (@ryan_prejean)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/custom-image-size-function/)
 * I’m trying to create a button or option on the upload screen that only doesn’t
   resize the image, so that I can pick and choose if I want different sizes for
   an image. I know the code below will unset the sizes all the time if put in functions.
   php . Is there a way to only implement it when a checkbox or some similar option
   is clicked?
 *     ```
       function custom_filter_image_sizes($sizes) {
   
       unset( $sizes['thumbnail']);
       unset( $sizes['medium']);
       unset( $sizes['large']);
   
       return $sizes;
       }
       add_filter('intermediate_image_sizes_advanced', 'custom_filter_image_sizes');
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [mjassen (mjjojo)](https://wordpress.org/support/users/mjjojo/)
 * (@mjjojo)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/custom-image-size-function/#post-5141284)
 * Hi!
 * I noticed that the WordPress Upload New Media (WordPress’s built-in multi-file
   uploader) by default will upload the original image (not resized) along with 
   the thumbnail, medium and large copies of the image.
 * Can you just leverage the original image for your purpose?
 *  Thread Starter [Ryan_Prejean](https://wordpress.org/support/users/ryan_prejean/)
 * (@ryan_prejean)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/custom-image-size-function/#post-5141287)
 * Well, my site uses a ton of images and I don’t need the large and medium versions
   for most of them. In order to save space, I would like to stop WordPress from
   saving those files in the first place. However, sometimes I do need the alternate
   sizes, so I don’t want to globally disable it.
 *  [mjassen (mjjojo)](https://wordpress.org/support/users/mjjojo/)
 * (@mjjojo)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/custom-image-size-function/#post-5141304)
 * Have you checked out this plugin [Resize Image After Upload](https://wordpress.org/support/plugin/resize-image-after-upload)?
 * What do you think of it for this purpose?
 * In its settings it has an “Re-size images: ” Yes/No dropdown box which could 
   be toggled before/after an upload.
 * How close is that to the “checkbox” functionality that you were envisioning?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Image Size Function’ is closed to new replies.

## Tags

 * [custom image size](https://wordpress.org/support/topic-tag/custom-image-size/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [media upload](https://wordpress.org/support/topic-tag/media-upload/)
 * [resizing](https://wordpress.org/support/topic-tag/resizing/)

 * 3 replies
 * 2 participants
 * Last reply from: [mjassen (mjjojo)](https://wordpress.org/support/users/mjjojo/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/custom-image-size-function/#post-5141304)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
