How To Stop WordPress From Creating New Image Sizes
WordPress is becoming very popular day by day. WordPress provides a very user-friendly system that allows beginners to build websites very easily.
Even though WordPress is very user-friendly but it does have some problems. One of the biggest problems of using WordPress is managing the files. WordPress creates many files while operating.
Every time you upload a picture to your website, it creates some resized pictures to feed the header, featured image, homepage thumb and recommended stories. Besides that, it even creates three resized photos when you upload a picture.
As a result, uploading a single image may generate more resized images. It may sound innocent, but it will make a huge number of images on your server. Ever wondered how to stop the WordPress theme from creating regenerated images in different sizes?
The matter of great sorrow is that these images will become obsolete once you use a different theme. A new theme will require different types of image resolutions which the previously generated images won’t match. This will cause several numbers of unused and unnecessary files on the server.
Even if you generate new images for the site then you will see a huge number of obsoleted images on your server. You can always manually remove the unnecessary image files but that’s a pain that we don’t want to take.
Prevent WordPress from Creating Auto Resized Images
Stop WordPress From Auto resizing images in the media option. By default WordPress creates three resize images. They are Thumbnail size, Medium size, Large size. I always stop WordPress from resizing in these sizes. Most of the times these are not required. Your WordPress theme will automatically resize the images it requires. In order to prevent WordPress from creating these three sizes images you can follow the below steps.
- Go to Settings
- Then media
- You will see three options as Thumbnail size, Medium size, Large size
- You need to turn all the values to “zero” like the image below
- Turn all the values like the image above and WordPress will stop resizing the images into these three sizes
How To Stop WordPress From Creating New Image Sizes
All the WordPress themes use custom image sizes for header, slider, featured images and other blocks. In order to provide the fast-loading, these images come very handy. However, if you really want to stop WordPress these types of images to generate then you can do that too.
Important Note:
Preventing WordPress from creating these images may cause some trouble. It may cause the thumb, slider or other blocks to perform differently. You need to double-check before proceeding.
In order to see how many images are being generated by your current WordPress account, you need to go the Cpanel first. Then open the file manager and select your site.
Now go to the Wp-Content > Upload folder. Then choose the current month’s number. For December it is 12. After that, you will be able to see how many sizes of pictures have been resized like the picture below.
You will see that the theme itself generated four different sizes of the image of the original image. It can be stopped but the site’s thumb may not work properly.
In order to prevent the WordPress theme to generate custom sizes images for itself, we need to go to the functions.php file. It can be accessed via the WordPress theme editor or from the Cpanel also. We are assuming that you already know that.
After that, search this quoted like : add_image_size
function and see if any result occurs. It will look something like below:
add_image_size( ‘featured-blog-large’, 750, 350, true )
We can see that the theme itself requires 4 resized images for its different header, featured blocks. We can prevent the Theme from creating any. In order to prevent WordPress to create a new image file, you need to delete these lines. For example, if we delete these four lines, it will not generate new image sizes.
There are another set_post_thumbnail_size
function. Search for it and delete it if it exists. Note that, doing this may cause new posts to have irregular thumb pictures. If you can’t find these codes in the theme function file then you need to check them on other files.
This is how to stop WordPress from creating new image sizes. If you are about to change your WordPress theme in the coming days this may be very handy until you made the changes. If you face any type of problem while removing unnecessary image files; you can always post a comment in the comment section below. Happy blogging !!!