Restrict Gutenberg Blocks to Single Use

For anyone who needs this too, here is how you restrict a block for single use only:

// A Sample Block
    'name'              => 'blockname',
    'title'             => __('Block Name','slug'),
    'description'       => __('A translatable description','slug'),
    'render_callback'   => 'theme_block_render',
    'category'          => 'embed', //the block category (optional)
    'align'             =>  'wide', // default value for width
    'mode'              => 'auto', // default value for switching auomatically between edit and view mode
    'supports'          => array('align' => array('wide','full' ),'multiple' => false), // wide and full are optional, those are for setting the width. SET MULTIPLE TO FALSE HERE!
    'icon'              => 'welcome-view-site', // Use a dashicon, for example dashicons-welcome-view-site
    'keywords'          => array( 'blockname', 'image','text' ), //set some keywords for search

Further documentation can be found here:

Leave a Comment