Buy All 48 Premium WordPress Themes for $54.99

How to Reduce Inode Count in WordPress: Reduce Number of Thumbnails

Inode Count WordPress

What is Inode?

It a record in hosting disk table that contains info about directory or file (owner, size, etc). So, the total number of files and directories equals to the number of Inodes.

Why Should We Reduce Inode Count in our Hosting?

Most hosting plans come with a limit of Inodes count. In other words, you may have to reduce the number of files and directories in your hosting if have too many files and directories/

Here is an easy way to reduce number of files if you use WordPress:

Did you know that when you upload a new media file, it usually creates about 10 different image files.

For example, if you upload an image file sunset.png, it will create:

  1. /wp_site_folder/wp-uploads/2018/09/19/sunset_50x50.png
  2. /wp_site_folder/wp-uploads/2018/09/19/sunset_150x150.png
  3. /wp_site_folder/wp-uploads/2018/09/19/sunset_250x250.png
  4. /wp_site_folder/wp-uploads/2018/09/19/sunset_350x350.png
  5. /wp_site_folder/wp-uploads/2018/09/19/sunset_550x550.png
  6. /wp_site_folder/wp-uploads/2018/09/19/sunset_650x650.png
  7. /wp_site_folder/wp-uploads/2018/09/19/sunset_800x800.png
  8. /wp_site_folder/wp-uploads/2018/09/19/sunset_900x900.png
  9. /wp_site_folder/wp-uploads/2018/09/19/sunset_1200x1200.png
  10. /wp_site_folder/wp-uploads/2018/09/19/sunset.png

It means that for every 1 uploaded image, WordPress will create 10 different files (same image resized to different resolution) which is 10 different Inodes.

So, if you upload 100 images, it will lead to 100 x 10 = 1000 Inodes.

Why it happens?

Every time there is a new image size defined (WP functions: add_image_size and set_post_thumbnail_size) in plugins and themes, it is how we ‘tell’ WordPress to resize every uploaded image and store a file into that resolution.

For example, if you install a Recent Posts with Thumbnails plugin, it make sense to store small images for recent posts thumbnails.

But if it is critical to reduce Inodes count, it can be done by reducing the number of Thumbnail images. Here is how it can be easily done (without any code change in plugins or theme):

1. Install and Activate ‘Stop Generating Image Sizes‘ Plugin

Stop Generating Image Sizes Plugin

Source: https://wordpress.org/plugins/image-sizes/

Then:

  1. Navigate to Admin Panel -> Left Menu -> Image Sizes
  2. Click ‘Select All’
  3. Click ‘Save Changes’ button

It simple DISABLES all image size definitions defined into plugins and themes.

2. Install and Activate the ‘Force Regenerate Thumbnails’ plugin

Source: https://wordpress.org/plugins/force-regenerate-thumbnails/

Then:

  1. Navigate to Admin Panel -> Left Menu -> Tools -> Force Regenerate Thumbnails
  2. Click on ‘Regenerate All Thumbnails’ buttons and wait until it finish

Force Regenerate Thumbnails

Please Note: It’s a good idea to backup before you execute the above. Also, some themes generates their own image sizes and they may not display content properly after applying the above.

But if you use a WordPress theme by Tishonator.com, there is nothing to worry about 🙂 Our themes will work like a charm after applying the above optimization.

About the Author

Tihomir Ivanov is a WordPress and Salesforce Commerce Cloud (SFCC) developer, founder of tishonator.com, a fan of Linux and Open Source, Minimalism (in Design and Life), Sci-fi, Fantasy, Classic and History books :)

One Response to “How to Reduce Inode Count in WordPress: Reduce Number of Thumbnails”

  1. Thanks for this post! I was nearly the limit of my inode usage with my web host and wasn’t sure how to reduce my inodes. This reduced my inodes by a lot! Much appreciated!

Leave a Reply