# Hide Specific Blocks From the Inserter

> Removes the core blocks you list from the post editor, so writers only see the blocks you want them to use.

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

## Code

```php
add_action( 'enqueue_block_editor_assets', function () {
    // Block names to remove.
    $blocks = array( 'core/verse', 'core/pullquote' );

    wp_add_inline_script(
        'wp-edit-post',
        'wp.domReady(function(){' . wp_json_encode( $blocks ) . '.forEach(function(name){if(wp.blocks.getBlockType(name)){wp.blocks.unregisterBlockType(name);}});});'
    );
} );
```

## Notes

Posts that already contain a removed block will show it as unsupported in the editor.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Specific Blocks From the Inserter" 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/
