How to disable Gutenberg editor?

Yes, you can disable it.

You can do this with code

If you want to disable it globally, you can use this code:

if ( version_compare($GLOBALS['wp_version'], '5.0-beta', '>') ) {
    // WP > 5 beta
    add_filter( 'use_block_editor_for_post_type', '__return_false', 100 );
} else {
    // WP < 5 beta
    add_filter( 'gutenberg_can_edit_post_type', '__return_false' );
}

And if you want to disable it only for given post type, you can use:

function my_disable_gutenberg_for_post_type( $is_enabled, $post_type ) {
    if ( 'page' == $post_type ) {  // disable for pages, change 'page' to you CPT slug
        return false;
    }

    return $is_enabled;
}
if ( version_compare($GLOBALS['wp_version'], '5.0-beta', '>') ) {
    // WP > 5 beta
    add_filter( 'use_block_editor_for_post_type', 'my_disable_gutenberg_for_post_type', 10, 2 );
} else {
    // WP < 5 beta
    add_filter( 'gutenberg_can_edit_post_type', 'my_disable_gutenberg_for_post_type', 10, 2 );
}

PS. If you don’t want to support older versions, you can ignore filters beginning with ‘gutenberg_’, so no version checking is needed in such case.

Or using one of existing plugins

  1. Classic Editor
  2. Disable Gutenberg
  3. Guten Free Options
  4. Gutenberg Ramp

Leave a Comment