How to Prevent WordPress from Generating Image Sizes

WordPress has many default settings, though some of these settings are fine to be left alone, there are others that some may prefer to have changed.One such default action that WordPress will take from the get-go is generating various image sizes for the pictures that you upload to your media file.

There are a couple reasons why you might want to do this.

  1. It’s Often Redundant. When uploading an image to your Media file, there is a huge possibility that you’re only going to use it once and you are only going to use actual size. However, if you keep the Media Settings as-is, then WordPress will actually create multiple versions of your image. Therefore, you will be left with extra images that are stored on your server that you neither need nor plan to use.
  2. Backups Can Get Time-Consuming. Creating a backup of your site is something that every website owner should do and do often. However, with your Media Settings left untouched over time the more pictures your add, the higher your number of unused images on your server become. As a result, creating backups of all the files on your server (which include these unused images) will start to take longer and even hours (!) depending on how many images it needs to save.

Let Fix it.

Firstly lets deactivate from the WordPress default setting

  1. Login To Your WP Dashboard.
  2. Go to Settings and then, Media.
  3. Here you will find 3 various image sizes: thumbnail, medium, large. Decide which image sizes you won’t be using and then set those sizes to 0.
  4. Update and save your new settings.

From now onwards WordPress will not generate extra images.

Another part is your is generating multiple images, do deactivate this feature

  1. Go to your WP Dashboard.
  2. Navigate to Appearance and then, Editor.
  3. Find your theme’s function.php file and click on it (find it on the right-hand side).
  4. Search for the following code: add_image_size and/or set_post_thumbnail_size. If the PHP file contains that code it will appear there and that means that your theme is generating images. If no image_size source code is shown, then you’re in luck.
  5. If you find that your PHP file has the above mention code, then you need to delete the code(s) and update your files in order to cut those out.
Thanks

Leave your comment