How to View and Delete Thumbnails in WordPress?

Managing images in WordPress is a simple task if taken care at the beginning of building your site. Else it will become a cumbersome task to cleanup your files at later stage when your site has grown larger in size. Each image you upload in your WordPress site will generate multiple thumbnails to display it in various places like recent posts, featured posts, header slideshow, etc. Since most hosting providers have restriction on file count at account level it is necessary for each WordPress site owner to manage images effectively by restricting the number of thumbnails generated.

In this article we will discuss how to view and delete thumbnails in WordPress installation.

  1. How WordPress generates thumbnails?
  2. Why thumbnails are accumulated?
  3. Why you should cleanup thumbnails?
  4. View thumbnails generated on your site
  5. Disable thumbnail registration
  6. Delete unused thumbnails with File Manager or FTP
  7. Cleanup with free WordPress plugins
  8. Cautions before cleaning up

1. How Thumbnails are Generated in WordPress?

WordPress generates thumbnails in one of the following three ways:

  • Thumbnails generated by default media settings in WordPress
  • Theme generated thumbnails
  • Thumbnails generated by a plugin

2. What Causes Thumbnail Accumulation?

There will be lot of unnecessary images accumulated over the period of time when you are running a blog for many years. Some of the reasons could be:

  • You have changed the theme in-between.
  • You have added many plugins in-between.

Both the above scenarios are very common for a site running for long time. The theme and most of the plugins will generate thumbnails in addition to the default thumbnails generated by WordPress. In an average all those decorative themes will generate around 10 to 20 thumbnails for each single image you upload on your WordPress site. Below is an example count of thumbnail generation in a WordPress site – the actual count may differ based on your theme and plugins:

TypeCount
Original Image1
Thumbnails Generated by WordPress Media Settings3
Thumbnails Generated by Theme10
Thumbnails Generated by a Plugin2
Total16

Default themes like twenty fourteen offered by WordPress will generate three thumbnails in normal, medium and large sizes based on your media settings. Other complex themes will register various sizes of thumbnails in functions.php file. These thumbnails are then used in places like featured image, recent post, featured post, popular post, related post, etc. Choosing the right theme is one of the important factors in running a successful WordPress site. Most of the users choose free themes at the start and struggle to migrate later when the site grows in size. All those attractive free and premium themes showcasing multiple images on the demo pages are really not useful for practical purposes.

Also plugins for sliders, galleries, reviews, etc. will generate thumbnails to display it in appropriate places.

3. Why Do You Need to Cleanup Thumbnails?

The simple reason to cleanup the thumbnails is to reduce the file count limit of your hosting account as decided by the hosting service provider. As explained in the above table, if your site has 2000 images then the total final file count will be 2000*16=32000. This is more than sufficient to reach the threshold of 50000 files if you use Bluehost for example.

Besides file count limit, each image in a web page will send a separate HTTP request to server thus increasing the page loading time. Hence, use images only if it is required and reduce thumbnails as much as possible. Learn more about optimizing images on WordPress.

When you migrate one theme from other or adding/deleting plugins on your site, old accumulated thumbnails will be left alone on the server without any use. You should periodically cleanup these thumbnails and regenerate new ones required for your installation for the below reasons:

  • Unnecessary images occupy the storage space on your server and increase the cost of your hosting.
  • When the theme is changed all old images will not have correct thumbnails as per the new theme. This will force the original images to be served as it is and then resized according to the required size on sliders and widgets. Without the correct thumbnails the speed of your site will get drastically affected.
  • The look of your site will get impacted when the required thumbnails are not available.

4. View Thumbnails Generated on Your Site

You can view all the uploaded media files from the menu “Media > Library” in your WordPress admin panel. But media library does not show the thumbnails generated on your site. So the of images in media library may lead to misunderstanding as it does not include thumbnail images. Below are some of the ways to check the number of images on your site. Number of thumbnails equals to total number of images minus the number you see in the media library.

  1. Use “File Count” option in “File Manager” to view directory wise files. This option may not be available in all hosts.
  2. Use FTP to check the numbers under “Uploads” folder. You may need to add number of files in different directory, especially if you have stored images month wise.
File Count Option in Bluehost
File Count Option in Bluehost

Generally thumbnails are shown with the image dimensions. For example, if your original image is “image.png” then the thumbnail name could be “image-65×65.png”. This indicates that your theme generates a image size of 65×65 pixels for each original image you upload.

If you can’t find the number of images then simply discuss with your hosting company to get the details.

5. How to Reduce WordPress Thumbnails?

5.1. Reducing Theme Thumbnails

As explained in the above example, most of the beautiful themes generate more than 10 thumbnails per image in order show it in sliders, widgets, related posts and as featured images. Once you decided to go for any particular theme check the number of thumbnails generated by uploading an image.

5.2. Reducing Plugin Thumbnails

Plugins also generate separate set of thumbnails especially slider and gallery plugins will generate huge number of thumbnails with various sizes. New set of thumbnails will get generated every time you try changing the dimensions. It is recommended to test these types of plugins on your local development server before install them on your live site.

6. Disabling Thumbnail Registration

Most of these image thumbs are used based on the type of layout you select in your theme. If you use uniform layout through out (which is the case with most of the sites and themes) your site then other images thumbs will never be used in your site. For example, your theme may offer related posts at bottom or left/right side and generate separate image thumbs. When you decided to go with bottom option the other thumbs still generated for left/right option will never be visible or used unless you switch the layout again. You need to unregister these unwanted thumbnails in order to avoid auto generation using one of the following options.

  • Disable registration in functions.php file
  • Disable default thumbnail generation in “Media” settings
6.1. Deregister Image Size in functions.php File
  • Navigate to “Appearance > Editor” option in your WordPress admin panel.
  • Locate functions.php file.
  • Deactivate the thumbnail registrations, which you don’t need as shown in the example below:
Deactivate Thumbnails in WordPress Theme
Deactivate Thumbnails in WordPress Theme
  • Save your changes.

Now try to upload an image and check the file count in your hosting account, you will not be seeing those unregistered image thumbs.

Similarly, you can unregister image thumbs in functions.php file of that particular plugin under “Plugins > Editor” section.

6.2. Stop Generating Default WordPress Thumbnails

Though you don’t use default WordPress theme, thumbnails will still be generated as per your medial settings. If you do not need WordPress to automatically generate normal, medium and large thumbs then make the dimensions as 0 under “Settings > Media”.

Stop Default Thumbnail Generation in WordPress
Stop Default Thumbnail Generation in WordPress

7. Deleting Unused Thumbnail Images

If your file count is already exceeded the limit set by the hosting provider, you can clean up your site with the two major activities.

  • Delete all unused and unnecessary plugins, which generate thumbnails.
  • Normally images are stored along with the size in your server. If you know what are the sizes you need it on your site, then delete all other sizes. This is an easy task of sorting and deleting based on size in your local PC or Mac if your site is not yet uploaded in live server. On a live site you can delete files from file manager option in your hosting account or using FTP software like FileZilla.

8. Deleting Thumbnails Using Free Plugins

You can cleanup the thumbnails either manually using FTP or using plugins. The FTP method will take large amount of time especially if you have organized your images under month and year folders. The plugin method is simple and will take considerably lesser time based on the number of images on your installation. There are many plugins available for this purpose and we will explain here with two ways.

  • Using “Force Regenerate Thumbnails” plugin.
  • Using”Thumbnail Cleaner” and “Regenerate Thumbnail” plugins.

8.1. Force Regenerate Thumbnails

This is a very straight forward way of cleaning up the thumbnails. Install and activate “Force Regenerate Thumbnails” plugin. This plugin will help you to delete all unused thumbnails and generate new thumbnails as per the new theme and setup. You can either regenerate on bulk or choose selected images from “Media > Library”.

Force Regenerate Thumbnails
Force Regenerate Thumbnails

The progress of the regeneration and the details for each image will be shown. You can clearly see how many thumbnails are deleted and how many are newly generated.

Deleting and Regenerating Thumbnails
Deleting and Regenerating Thumbnails

 8.2. Using Thumbnail Cleaner and Regenerate Thumbnails Plugins

In this method you need two plugins to do the cleanup task. The advantage here is you will take the backup of all your images before the regeneration. You can use this backup for restoring purpose in case of any issues.

8.2.1. WordPress Thumbnail Cleaner Plugin
WordPress Thumbnail Cleaner Plugin
WordPress Thumbnail Cleaner Plugin

Install and activate the thumbnail cleaner plugin from your WordPress admin panel. It will create a new menu named “Thumbnail Cleaner” under “Tools” menu. Using the plugin is very simple with each available option is just a click of button.

WordPress Thumbnail Cleaner Plugin Options
WordPress Thumbnail Cleaner Plugin Options

1. Backup – As a standard process, before doing any irreversible action (like deleting thumbnails) you need to backup the content. You can do this with single click and the plugin will backup all your images and media files under “uploads” folder to a separate folder under “wp-content/backups/thumbnail-cleaner/”.

2. Analyze – Use this option to check how many thumbnail files can be deleted from your WordPress installation. This will be give you an estimation of how many files are generated compared to the actual number of media files you can see under “Media > Library”.

3. Clean Thumbnails – Once you decided to cleanup the thumbnails, click on this button to delete them.

4. Regenerate Thumbnails – We will explain this option in next section below.

5. Restore Backup – In case of any issue, you can just restore your “uploads” folder with the backup files.

8.2.2. Regenerate Thumbnails

Once you deleted all thumbnail, the look of your site may change since the images will be served from the original size (by resizing) instead of the thumbnails. The reason is simple since the actual thumbnails used by your current theme are also deleted when using the “Thumbnail Cleaner” plugin. The solution to bring the site back to shape is to regenerate images to create only required thumbnails for your site.

The fourth option”Regenerate Thumbnails” with “Thumbnail Cleaner” plugin is for this purpose and you need a separate plugin for this. Navigate to “Plugins > Add New” section and look for the “Regenerate Thumbnails” plugin.

WordPress Regenerate Thumbnails Plugin
WordPress Regenerate Thumbnails Plugin

Install the plugin from Alex Mills with over 1+ million active installs and activate it. Then navigate to “Tools > Regen. Thumbnails” section and regenerate all the images on your site. The process may take long time depending on the number of images on your site.

Regenerating Thumbnails in WordPress
Regenerating Thumbnails in WordPress

Clear the cache and check your site, it should come back to normal shape. Now your WordPress site will only have the required thumbnails which you can check by clicking on the “Start Analyzing” button from “Thumbnail Cleaner” plugin.

9. Caution for Regenerating Thumbnails

Regenerating thumbnails of each image is a resource intensive process, so be aware of the followings:

  • This will shoot up the CPU consumption of your hosting server.
  • If you have large number of images then we recommend to run the regeneration process from media library by selecting page by page (that is 20 images per execution).
  • If you are running a site on shared hosting server, you may end up in account banning for exceeding the CPU / execution limit. So run the regeneration on limited images or discuss with your hosting company if they can help to increase the resources for you.
  • The live site will be slow during regeneration, hence run the regeneration when there is less traffic on your site.
  • When you have image optimization plugins like WP Smush with the “optimize images on upload” option is enabled, regeneration will also call the optimization process and result in heavy consumption of server resources. So you can disable image optimization plugins and then optimize the images later or run regeneration on limited number of images on batch.

Editorial Staff at WebNots are team members who love to build websites and share the learning with webmasters community. Follow us on Facebook and Twitter.

15 thoughts on “How to View and Delete Thumbnails in WordPress?”

Leave your response.

  1. Thank you so much! I’ve been struggling to figure out why my new website is already at my file number limit – I’ve got a vintage collectible store with thousands of items. And as I’ve been uploading and working on things, wordpress has been making tons of additional files that I didn’t realize weren’t deleted when you delete things from the trash! Awesome article, now I can finally finish my import and focus on getting a sale (once I delete thousands of unattached images and thumbnails, etc, lol). YOU ROCK!!!

    Reply
    • Thanks for the read. You need to be careful in deleting the thumbnail used by plugins and theme. Otherwise the front end display will get distorted with larger image cropped into smaller or otherwise.

      Most importantly, resizing image on the front end will drastically impact the page loading speed. You should only cleanup those unused thumbnails occupying space and counting in the file limit.

      Reply
  2. I just found out, that my wordpress generates 14 thumbnails, because of Avada and some Plugins I use. I just use 4 of them and I will start to stop the generation now. I just wonder if there is a php-script to find the old thumbnails and batch delete them?

    Reply
  3. I smushed all the images through WP-Smush, as a result, the images were resized and now they appear broken in the google search results, I have worked really really hard to get my site and some of my images to get ranked in google …. but smushing them has turned the situation for me into a nightmare, I have searched everywhere on the web, but i can’t seem to find a proper solution for it …. I’m not sure if I am suppose to Regenerate thumbnails here?. I surely can’t bear to make another mistake.

    Reply
    • I would suggest to optimize yje images using Photoshop and them connect via ftp to your site to replace the files. If the smushing didn’t mess up how images are served, that might help restore files that would show correctly and work with Google results. Good luck! :)

      Reply
      • In the Media Library, None of the images look distorted, it’s the thumbnail that appears in the search results which shows up broken, I tried Re-scaling the images, and as a result ranked images have disappeared from the Search Results. Now only when they Re-Appear I guess i would be able to know exactly if Re-scaling solves the problem.

        When you go to Edit the Image in the Media Library You get these options

        Apply changes to:
        All image sizes
        Thumbnail
        All sizes except thumbnail

        I chose Re-scaled for All image Size (The First option) but now I am wondering I should have used the Thumbnail (Second Option)

        Reply
    • Try smush few images and check the quality instead of running bulk smush. In most cases, the plugin does not resize the image unless your original images are too large and the resize dimension is comparatively small. In such case, you can disable resizing option or provide larger size for resizing.

      Thumbnail regeneration is nothing to do with your original images. It will only add the registered sizes of thumbnails by your theme/plugins and serve wherever required (like small images on sidebar widgets).

      Reply
  4. Question: To avoid to increase server load, saving time and resources (and avoiding being banned for excessive CPU execution time), wouldn’t it make sense to backup a WP site and replicate it on a local dev machine using a plugin like Duplicator, and then perform all the optimization and cleanup on the local machine where one can use all the CPU and needed resources without issues? Once done a new backup can be made from the local machine to re-deploy the freshly cleaned up WP site… in some cases that might make more sense perhaps?

    Reply
    • It is possible but not make good sense. For a larger site, duplicator or any other plugin will consume similar server resource like thumbnail regeneration (Duplicator site’s homepage clearly mention this point). Also it is a huge time consuming process to move up and down the whole content of the site from localhost to server.

      We doubt whether the images are backed up when they are hosted outside uploads folder (say on subdomain). If you need to use FTP then by that time you can complete the thumbnail regeneration.

      Ideal solution is to regenerate the images in small batches from media library.

      Reply
  5. Hi
    Thanks for this post: I was searching a plugin like Thumbnail Cleaner.
    But just one question:
    If I have already the “Force Regenerate Thumbnails” plugin installed I think I do not need to install “Regenerate Thumbnails” plugin because the firt one do the job, isn’t it?
    Thanks

    Reply

Leave a Comment