Row wavy Shape Decorative svg added to bottom

How to keep the menu visible in the WordPress editor

For some reason, the default WordPress editing experience hides the dashboard menu. This can be confusing for beginners (“How do I exit the editor?”) and annoying for power users (“Why so many clicks to get to where I want to go?”).

Yes, there is a user-configurable option for whether or not to show the dashboard menu in the editor. However, I don’t expect a beginner to know about that setting (and even if they did, could they find it?). I want the menu to be displayed for all users at all times. Here’s the code to make that happen:

/**
 * Disable Fullscreen Gutenberg.
 */
function prefix_disable_fullscreen_by_default() {
	$script = "window.onload = function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } }";
		
	wp_add_inline_script( 'wp-blocks', $script );
}
add_action( 'enqueue_block_editor_assets', 'prefix_disable_fullscreen_by_default' );
Posted in ,

1 thought on “How to keep the menu visible in the WordPress editor”

  1. Hi Alex,

    Thanks for sharing this practical code snippet! The default fullscreen mode in the Gutenberg editor can be quite confusing, especially for beginners who suddenly find themselves missing the dashboard menu.

    Your solution is an excellent way to improve the user experience and eliminate unnecessary clicks by keeping the menu visible for all users at all times. It definitely saves a lot of time and frustration in the daily workflow.

    This is a great hack that I’ll certainly keep in mind for future projects!

    Best regards,
    Marc Wayne Schechtel

Leave a Comment

Your email address will not be published. Required fields are marked *