Register a custom image size, like a 1200×630 social card, and make it selectable in the Image block's Resolution menu.
add_action( 'after_setup_theme', function (): void {
add_image_size( 'nahnu-wide', 1200, 630, true );
} );
add_filter( 'image_size_names_choose', function ( array $sizes ): array {
return array_merge( $sizes, [
'nahnu-wide' => 'Wide (1200×630)',
] );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Theme-registered image sizes are created on upload, but they don’t show up in the editor unless you list them. This snippet does both, so editors can pick your size from the Image block.
add_image_size() registers a size by name, width and height. The last argument, true, crops images to exactly that shape. Use false to scale them to fit instead.
The image_size_names_choose filter adds the size to the Resolution menu in the Image block and the classic media dialog.
Upload an image, add it with the Image block and open the Resolution menu. “Wide (1200×630)” should be listed.