How to prevent upload of a multiple sizes of images

The question:

on my theme, i found this script

add_image_size( 'slider', 464, 249, true );
add_image_size( 'fmenu', 306, 280, true );
add_image_size( 'teamthumb', 138, 207, true );
add_image_size( 'imlink', 286, 140, true );
add_image_size( 'albmlink', 274, 274, true );
add_image_size( 'fppost', 90, 90, true ); 
add_image_size( 'fslide', 520, 280, true );  

i have disabled this, but when i upload another image, its generates 3 more images… like this:


i need only to upload the original file, there’s a way to solve this??

I can’t find where is this another 2 images sizes…

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

I believe those are probably generated by the default WordPress sizes – thumbnail, medium and large. (See Appearance > Media for where those sizes are set).

If you want to eliminate the extra image sizes the simplest way might be to eliminate some of your theme’s custom image sizes and use the defaults instead. OR, you can “unset” the defaults. This article explains how to do that, but to sum up here’s the code you’d add to your theme’s functions.php file:

 * 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
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');

Hope this helps, best of luck!

Method 2

If those are the default alternate sizes, you don’t need any code to do this.

To get rid of the default alternate sizes, just go to Settings > Media in the admin, and set the sizes for “Thumbnail”, “Medium” and “Large” to 0px by 0px. Once you save these settings, WordPress will no longer create the alternate sizes (unless additional sizes are specified in a plugin or in your functions file).

Media Settings Page

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment