Disable auto creating of image sizes

WordPress creates by default 3 sizes for every image which is uploaded to the media library. This snippet unsets these sizes so only the original size is left on the server.

/**
 * Snippet Name: Disable auto creating of image sizes
 * Snippet URL: https://www.wpcustoms.net/snippets/disable-auto-creating-image-sizes/
 */
  function wpc_unset_imagesizes($sizes){
    unset( $sizes['thumbnail']);
    unset( $sizes['medium']);
    unset( $sizes['large']);
}
add_filter('intermediate_image_sizes_advanced', 'wpc_unset_imagesizes' ); 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x