Insert Images at Large Size by Default
Makes new Image blocks and media inserted in the editor use the Large size by default, instead of the full original file.
Opens WPIDE on
Code
// Default size for inserted images.
$wpide_default_image_size = 'large';
add_filter( 'pre_option_image_default_size', function () use ( $wpide_default_image_size ) {
return $wpide_default_image_size;
} );
Notes
Change large to medium or another registered size.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.