Categories
Technical

šŸ§±Gutenberg: disableĀ / remove completely block editorā€™s tips

Gutenberg tips are tooltip panels displayed on the block editorā€™s interface the first time you open it.

Users frequently ask how to disable these tips. First method: go to editorā€™s options and uncheck “Tips” checkbox. The issue is that like many settings of the editor, these settings are saved on the userā€™s browser using LocalStorage. That way, the tips will come back everytime youā€™re using a different device to access the editor. It’s also necessary to use that method individually for each administrator of the website.

šŸ§ØHow to get totally rid of Gutenberg tips in the WordPress block editor

You just have to go to your theme (or your child theme) functions.php file and add the following snippet:

function jba_remove_gutenberg_tips() {
	$script = "
jQuery(document).ready(function(){
    var is_tip_visible = wp.data.select( 'core/nux' ).areTipsEnabled()
    if (is_tip_visible) {
        wp.data.dispatch( 'core/nux' ).disableTips();
    }
});	
	";
	wp_add_inline_script( 'wp-blocks', $script );
}
add_action( 'enqueue_block_editor_assets', 'jba_remove_gutenberg_tips' );

This snippet will implement a tiny 5-lines JS script to ask the editor to simply check by default the remove tips option in Gutenberg !

Et voilĆ ! šŸ‡«šŸ‡·šŸ˜Ž

Legal notice