Completly disable and remove Thumbnails?

To remove all extra image sizes you use get_intermediate_image_sizes() in tandem with remove_image_size(). E.g.

function remove_extra_image_sizes() {
  array_map( 'remove_image_size', get_intermediate_image_sizes() );
} 
add_action('init', 'remove_extra_image_sizes');

To edit the image size dropdown you can hook a custom function to image_size_names_choose filter.

function filter_image_size_names_choose($size_names) {
  return array_filter( $size_names, function( $size_name ){
    return 'full' === $size_name;
  }, ARRAY_FILTER_USE_KEY );
}
add_filter('image_size_names_choose', 'filter_image_size_names_choose');

Then use some thumbnail plugin to “regenerate” thumbnails. As the sizes are disabled the plugin should (in theory) just clean up any existing thumbnail files and data, leaving you with just the full size images.

Leave a Comment

tech