How to disable Fullscreen mode in Gutenberg WordPress editor
Starting with version 5.4, WordPress has made the Fullscreen mode the default mode for the built-in Gutenberg editor.
This means when an entry like a Page or Post is opened, by default it will be like this:
To turn this off, bring up the pulldown in the editor’s menu by clicking on the three vertical dots at the top right and select Top toolbar under View and click on Fullscreen mode to uncheck it.
This change applies only to you – the current user.
Note: If you log into an incognito window, the fullscreen editor will be back.
If you are looking to disable the Fullscreen Gutenberg for all users of the site all the time, add the following in your child theme’s functions.php
or a custom functionality plugin or using the Code Snippets plugin:
<?php
add_action( 'enqueue_block_editor_assets', 'wpdd_disable_editor_fullscreen_by_default' );
/**
* Disable Fullscreen Gutenberg.
*/
function wpdd_disable_editor_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 );
}
?>
Opening and closing PHP tags should not be entered when using Code Snippets plugin.
References
https://make.wordpress.org/core/2020/03/03/fullscreen-mode-enabled-by-default-in-the-editor/