NOTA

Disable WordPress Image Sizes – How-to – Code for functions.php

A ver si voy logrando quitarme de encima unos cuantos GB de espacio de todos esos thumbnails horribles.

WordPress wants to do us some good by generating additional image sizes. If you know what you’re doing, and you definitely don’t need these image sizes,

Origen: Disable WordPress Image Sizes – How-to – Code for functions.php

Parece que este funciona mejor (visto en https://wphelp.blog ).


/* Prevent WordPress from creating additional sizes */
function wphelp_disable_additional_media_wp($sizes) {
unset($sizes['thumbnail']); // disable thmbnail size
unset($sizes['medium']); // disable medium size
unset($sizes['large']); // disable large size
unset($sizes['medium_large']); // disable medium-large size
unset($sizes['1536x1536']); // disable medium-large x2 size
unset($sizes['2048x2048']); // disable large x2 size
return $sizes;
}
add_action('intermediate_image_sizes_advanced', 'wphelp_disable_additional_media_wp');
/* Prevent creation of scaling sizes */
add_filter('big_image_size_threshold', '__return_false');
Suscribirte
Notificación de
guest

0 Comments
Inline Feedbacks
View all comments