Home / Disable Thumbnail Image Sizes
Duplicate Snippet

Embed Snippet on Your Site

Disable Thumbnail Image Sizes

Prevent WordPress from generating specific thumbnail sizes.

400+
Code Preview
php
<?php
add_filter( 'intermediate_image_sizes_advanced', function( $sizes ) {
	// Disable specific thumbnail sizes, uncomment the ones you want to disable.
	// unset( $sizes['thumbnail'] ); // 150px x 150px
	// unset( $sizes['medium'] ); // 300px x 300px
	// unset( $sizes['medium_large'] ); // 768px x 0px
	// unset( $sizes['large'] ); // 1024px x 1024px
	// unset( $sizes['1536x1536'] ); // 1536px x 1536px
	// unset( $sizes['2048x2048'] ); // 2048px x 2048px
	
	return $sizes;
} );

Comments

Add a Comment