# Remove Unwanted Block Style Variations

> Hides block styles you do not want editors to use, such as the outline button or rounded image, from the block editor.

- Type: PHP
- Runs: Admin only
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: disable, blocks, editor
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-block-style-variations/

## Code

```php
// Block name => style names to remove.
$wpide_remove_block_styles = array(
    'core/button'    => array( 'outline' ),
    'core/image'     => array( 'rounded' ),
    'core/quote'     => array( 'plain' ),
    'core/separator' => array( 'dots', 'wide' ),
);

add_action( 'enqueue_block_editor_assets', function () use ( $wpide_remove_block_styles ) {
    wp_register_script( 'wpide-remove-block-styles', false, array( 'wp-blocks', 'wp-dom-ready' ), '1.0', true );
    wp_enqueue_script( 'wpide-remove-block-styles' );
    wp_add_inline_script(
        'wpide-remove-block-styles',
        sprintf(
            'wp.domReady(function(){var map=%s;Object.keys(map).forEach(function(block){map[block].forEach(function(style){wp.blocks.unregisterBlockStyle(block,style);});});});',
            wp_json_encode( $wpide_remove_block_styles )
        )
    );
} );
```

## Notes

Blocks already using a removed style keep it until edited.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove Unwanted Block Style Variations" 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/
