Can I stop wordpress generating media sizes
-
15-01-2021 - |
题
I am using atelier theme on a shop website and I have seen the disk space grow rapidly. In my analysis, I have noticed that Atelier is creating 17 different media sizes when it uploads an image:
thumbnail - 150x150
medium - 300x300
medium_large - 768x9999
large - 1024x1024
shop_thumbnail - 180x180
shop_catalog - 800x800
shop_single - 600x600
post-thumbnail - 220x150
widget-image - 94x70
thumb-square - 250x250
thumb-image - 600x450
thumb-image-twocol - 900x675
thumb-image-onecol - 1800x1200
blog-image - 1280x9999
gallery-image - 1000x9999
large-square - 1200x1200
full-width-image-gallery - 1280x720
This seems to be a little bit of overkill to me especially when uploading a batch of images sometimes results in memory overload = Error 500.
Not only is it now consuming GBs of space but there are 1000's and 1000's of files...
What happens if I do remove some of these media sizes? Will the website lose reference and display an missing image OR will it simple use an alternate size?
And also, is there a simple way to unlink and delete all the additional images size I no longer want?
解决方案
You can use remove_image_size()
to remove previously registered image sizes.
Ex : <?php remove_image_size('full-width-image-gallery'); ?>
Note: Cannot be used on reserved image size names