# Hide Design Controls From Authors and Contributors

> Hides color, typography, spacing and border controls in the block editor for authors and contributors, so they focus on writing while editors keep full design control.

- Type: PHP
- Runs: Run everywhere
- Category: [Block Editor](https://wpide.com/library/category/gutenberg/)
- Tags: theme-json, permissions, block-editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/themejson-simple-editor-for-authors/

## Code

```php
add_filter( 'wp_theme_json_data_theme', function ( $theme_json ) {
    if ( ! is_user_logged_in() || current_user_can( 'edit_others_posts' ) ) {
        return $theme_json;
    }

    return $theme_json->update_with( array(
        'version'  => WP_Theme_JSON::LATEST_SCHEMA,
        'settings' => array(
            'color'      => array(
                'background'     => false,
                'text'           => false,
                'link'           => false,
                'custom'         => false,
                'customGradient' => false,
                'customDuotone'  => false,
            ),
            'typography' => array(
                'customFontSize' => false,
                'lineHeight'     => false,
                'dropCap'        => false,
                'fontStyle'      => false,
                'fontWeight'     => false,
                'letterSpacing'  => false,
                'textTransform'  => false,
            ),
            'spacing'    => array(
                'padding'  => false,
                'margin'   => false,
                'blockGap' => false,
            ),
            'border'     => array(
                'color'  => false,
                'radius' => false,
                'style'  => false,
                'width'  => false,
            ),
            'shadow'     => array( 'defaultPresets' => false ),
        ),
    ) );
} );
```

## Notes

Users who can edit others' posts (editors, administrators) keep all controls. Styles already applied to blocks remain.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Design Controls From Authors and Contributors" 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/
