# Default Block Editor Preferences for Everyone

> Sets sensible defaults for every user of the block editor, such as the top toolbar, the List View opened and button text labels, while each person can still change them.

- Type: PHP
- Runs: Admin only
- Category: [Block Editor](https://wpide.com/library/category/gutenberg/)
- Tags: editor, preferences, defaults
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/default-editor-preferences/

## Code

```php
// Editor preferences (true or false).
$wpide_editor_defaults = array(
    'fixedToolbar'          => true,
    'showListViewByDefault' => true,
    'showIconLabels'        => false,
    'showBlockBreadcrumbs'  => true,
);

add_action( 'enqueue_block_editor_assets', function () use ( $wpide_editor_defaults ) {
    wp_add_inline_script(
        'wp-preferences',
        'wp.domReady(function(){(window._wpLoadBlockEditor||Promise.resolve()).then(function(){wp.data.dispatch("core/preferences").setDefaults("core",' . wp_json_encode( array_map( 'boolval', $wpide_editor_defaults ) ) . ');});});'
    );
} );
```

## Notes

Only defaults change; anything a user has already set in Preferences wins. Set a value to true or false to taste.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Default Block Editor Preferences for Everyone" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
