# Disable the Block Editor for Specific Post Types

> Keeps the block editor for posts but uses the classic editor for the post types you list (pages by default).

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

## Code

```php
add_filter( 'use_block_editor_for_post_type', function ( $use, $post_type ) {
    // Post types that should use the classic editor.
    $classic = array( 'page' );

    return in_array( $post_type, $classic, true ) ? false : $use;
}, 100, 2 );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Disable the Block Editor for Specific Post Types" 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/
