How to disable some of the generated image sizes?
-
Whenever someone uploads an avatar, different image sizes are automatically generated:
128×128, 64×64, 52×52, 26×26, etc.How do I disable all of them and only allow the ones I need?
I already have the following code in my theme to disable default wordpress image sizes:
/ disable generated image sizes function shapeSpace_disable_image_sizes($sizes) { unset($sizes['thumbnail']); // disable thumbnail size unset($sizes['large']); // disable large size unset($sizes['medium_large']); // disable medium-large size unset($sizes['1536x1536']); // disable 2x medium-large size unset($sizes['2048x2048']); // disable 2x large size return $sizes; } add_action('intermediate_image_sizes_advanced', 'shapeSpace_disable_image_sizes'); // disable scaled image size add_filter('big_image_size_threshold', '__return_false');
- The topic ‘How to disable some of the generated image sizes?’ is closed to new replies.