ult_images’ );
\/\/This will delete the default image size and medium_large size.
Function prefix_remove_default_images ($size){
Unset ($size [\
unset( $sizes[‘medium’]); \/\/ 300 pixels
unset( $sizes[‘large’]); \/\/ 1024 pixels
unset( $sizes[‘medium_large’]); \/\/ 768 pixels
Return $size;
} 
Then click save and activate. All image sizes mentioned in the code have been successfully deleted from the server. Looking closely at snipt, we disabled four image sizes. The first three are the default image size of WordPress. However, some themes and plug-ins also register custom images, so in this case, the media_large image is also disabled. Delete specific default image sizes now assume that you only want to disable medium and large sizes, rather than deleting all default image sizes. The code should be:
add_filter( ‘intermediate_image_sizes_advanced’, ‘prefix_remove_default_images’ );
\/\/This will eliminate the default image size of medium and large.
Function prefix_remove_default_images ($size){
unset( $sizes[‘medium’]); \/\/ 300 pixels
unset( $sizes[‘large’]); \/\/ 1024 pixels
Return $size;
}As you can see, the code is very easy to edit, so you can customize and delete the required default image size.
Note that if the default image size of WordPress is deleted from an existing image by disabling the default image size of WordPress in WP admin or by encoding, it is important that the old image is not deleted from the server. Instead of deleting the corresponding image size, word press is prevented from generating a copy of the image of the corresponding size. However, you can manually delete the default image size from an existing file. To check how to delete this thumbnail from word, please perform this operation. Bonus: what would you do if you wanted to add or change the custom image size in word press instead of removing the custom image size from the change site? It can be performed manually or using plug-ins. For more information, see the guide on how to add and change image sizes in word press.
Conclusion in general, it is not a good idea to keep the unnecessary image size because it takes up the space of the server. To optimize the media library, it is recommended that you remove the default image size from word press. There are two ways. In WP admin, both methods are simple and effective through coding. If you do not have encoding technology, you can edit the default image size on the media settings page and disable unwanted image sizes with a few clicks. On the contrary, if you want to build a solution, you can use and adjust PHP scripts. Finally, the function. Don’t forget to use subtopics or site-specific word press plug-ins before changing PHP files.
I hope this report will help. If you do, please share on SNS! What is the preferred way to disable the default image size? Do you know anyone else? Please tell the following comments.