Block Editor PHP Beginner

Turn Off Fullscreen Mode in the Editor

Open the block editor with the normal admin menu and toolbar visible, instead of WordPress's fullscreen mode.

Tested on WordPress 7.1 PHP 8.3 No plugin needed Updated
functions.php 6 lines
add_action( 'enqueue_block_editor_assets', function (): void {
	wp_add_inline_script(
		'wp-preferences',
		"wp.domReady( function () { wp.data.dispatch( 'core/preferences' ).set( 'core/edit-post', 'fullscreenMode', false ); } );"
	);
} );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

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.

The post editor opens in fullscreen mode by default, hiding the admin menu. People new to WordPress often think they’ve left wp-admin and can’t find their way back. This snippet opens it with the menu showing.

How it works

Editor preferences are stored in the core/preferences data store. The snippet adds a small script after the preferences package loads, and once the page is ready it sets fullscreenMode to false for the post editor.

Because it runs each time the editor opens, the menu always shows, even if someone turned fullscreen on last time.

Things to watch

  • Users can still toggle fullscreen from the Options menu, but it resets on the next page load.
  • The Site Editor always runs fullscreen and isn’t affected.

How to test it

Open any post in the editor. The admin menu should be visible on the left.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only