How to disable Gutenberg for specific post types

WordPress 5 isn’t far off now, and it ships with Gutenberg, the brand new content editor.

If you want to only allow the classic editor for certain post types, then add the code below to your theme. In this example, Gutenberg is disabled when editing pages.

function mytheme_disable_gutenberg_pages( $can_edit, $post_type ) {
  if ( 'page' === $post_type ) {
    return false;
  return $can_edit;
add_filter( 'gutenberg_can_edit_post_type', 'mytheme_disable_gutenberg_pages', 10, 2 );

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top