Skip to content

Instantly share code, notes, and snippets.

@jpmarchand jpmarchand/custom-image-sizes.php Secret
Last active Sep 27, 2016

Embed
What would you like to do?
Remove image sizes in WordPress. Source: http://www.wpmayor.com/remove-image-sizes-in-wordpress/
<?php
function wpmayor_custom_image_sizes($sizes) {
$myimgsizes = array("image-in-post" => __("Image in Post"), "full" => __("Original size"));
return $myimgsizes;
}
add_filter('image_size_names_choose', 'wpmayor_custom_image_sizes');
<?php
//* Remove image sizes in WordPress
function customprefix_remove_image_sizes($sizes) {
unset($sizes['medium']);
unset($sizes['large']);
unset($sizes['plugin-name-image-size']);
return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'customprefix_remove_image_sizes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.