Last active
July 19, 2021 16:12
-
-
Save nathaningram/79d6d16242fe98afecf4dbbf5818447b to your computer and use it in GitHub Desktop.
Unset Default WordPress Image Sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'intermediate_image_sizes_advanced', 'ni_remove_default_image_sizes' ); | |
| // Source quadlayers.com/remove-wordpress-default-image-sizes/ | |
| function ni_remove_default_image_sizes( $sizes ) { | |
| unset($sizes['thumbnail']); // disable thumbnail 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 2x medium-large size | |
| unset($sizes['2048x2048']); // disable 2x large size | |
| return $sizes; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment