An image can say thousand words – but you should be careful in using too many images in WordPress site. Using too many images in the frontend will slow down your site as each image sends a separate HTTP request to your server. Similarly, keeping too many unused images in the backend server will occupy the storage space over period of time. There are many image related plugins and cleanup options available to optimize the usage. If you find too many thumbnail images available in your uploads folder, then here is how to disable the image sizes in WordPress which you do not need and save storage space.
Why WordPress Generates Too Many Images?
WordPress uses the concept of adaptive images to serve appropriate sizes based on the view port of the device. It uses srcset attribute in HTML image tag to serve different sizes of the same image and the browser will pick up the correct size based on the device. WordPress by default generates small, medium and large thumbnail images based on the frontend admin settings and also generates few more thumbnails by default. You will see the original or larger image size when viewing the page in desktop while you will see the smaller thumbnails when viewing the same page in mobiles.
In addition, your theme and plugins can register additional image sizes to show in widgets like related posts and in home page. Putting together, a simple WordPress theme with few plugins can easily generate 5 to 10 images sizes (thumbnails) for each image you upload on your site. Unfortunately, you may not use all these thumbnails and unused images will be simply lying on the server occupying space.
The best example is using WooCommerce plugin with your blog. The plugin will generate three thumbnail images for showing in products and gallery. However, the plugin will also generate these thumbnails for each image you upload in your blog article which is absurd. Similarly, some magazine themes generate 10+ images for each original image. You can go to “Appearance > Theme File Editor” and check the functions.php of your theme to find the details. Search for “image_size” and you will find each registered image size with the dimensions.
You can simply comment those line in the file to deactivate the registered sizes. However, your changes will disappear when you update the theme. If you make a mistake in editing, the site will go down and you will lose the access to admin panel. Then you need to use FTP or File Manager to revert the changes. Instead of that, the best way is to use a plugin and disable these unnecessary image sizes registered by plugins, theme and WordPress and use only the thumbnail sizes needed for your site.
View and Disable Unused Images Sizes
If you want to check all the image sizes registered in your site and disable unused sizes, then follow the below instructions.
- When you are in admin panel, go to “Plugins > Add New” section.
- Search for “stop unnecessary” to find “ThumbPress – Stop Generating Unnecessary Thumbnails” plugin.
- When you install and activate the plugin, you will see a notification to run the setup wizard. You can either click on the “Run Setup Wizard” button or later go through “Media > ThumbPress” menu to disable unused image sizes.
Running Setup Wizard
Click on “Run Setup Wizard” button to see the three steps process. The first step is a welcome screen and simply click “Get Started…” button to move forward.
The next step will show all the registered images sizes available on your site. Click the switch under “Disable Thumbnail” column against the sizes you wanted to disable. Click “Next” button to go to last step.
The last step will show you a success message with other plugins from the developer and click “Finish” button.
Disable Thumbnails from Plugin Settings
If you did not see the setup wizard or closed the notification, then follow the below instructions.
- Go to “Media > ThumbPress” section where you can see all available image sizes under “Sizes Enabled (will be generated)” column.
- Drag and drop the sizes you do not want to “Sizes Disabled (will not be generated)” column.
- Make sure to scroll down to the bottom and click on “Save Settings” button to apply the changes.
You can anytime enable the sizes or click “Reset Default” button. After disabling image sizes, upload an image from “Media > Add New” or upload an image through post editor. Use File Manager or FTP and check there are no unnecessary thumbnails generated as per the plugin’s settings.
Regenerating Old Images and Deleting Old Thumbnails
After disabling unused image sizes, you need to check two more additional steps for already existing images on your site.
- Regenerate old images – if you want to regenerate thumbnails for the old images already uploaded, then go to “Regenerate” section. Enter the number of images you want to regenerate at single time and click on the “Regenerate” button. The progress bar will run showing the status and the plugin will generate thumbnails for the enabled image sizes.
- Deleting old unused thumbnails – we do not see the plugin delete any unused thumbnails when you use regenerate option.
So, we do not recommend using regenerate option in this plugin. If you have large number of images to regenerate or delete, then use Force Regenerate Thumbnails plugin. This plugin will do both regeneration as well as deleting unused thumbnails. You can choose a single image or bulk from the media library to regenerate thumbnails. Learn more on how to cleanup thumbnails in WordPress.
Disable Default Image Sizes in WordPress Admin Panel
If you only want to disable the default image sizes generated by WordPress and do not want to touch the theme or plugin setup, then you can disable the sizes from admin panel settings.
- Login to your site’s admin panel and navigate to “Settings > Media” section.
- You will see three image sizes for 150×150, 300×300 and 1024×1024 as shown below.
- Make all the values zero and click “Save Changes” button.
This will disable three default thumbnails that WordPress generates automatically.