Gutenberg is the right tool for blog posts and pages where editorial layout matters. It’s often the wrong tool for custom post types that exist to hold structured data, portfolios, testimonials, team members, events, and product listings are all examples where the content is managed through custom fields, not a freeform block canvas. In those cases, the block editor adds interface complexity without any benefit, and can actively conflict with page builders or custom field plugins that have their own editing UI.
This snippet gives you surgical control, disabling Gutenberg only for the post types you specify while leaving it active for posts, pages, and any other post type not in the list.
The Code
Add this to your functions.php or a site-specific plugin. Update the $disabled array with the slugs of the post types you want to keep on the classic editor, these are the programmatic slugs passed to register_post_type(), not the labels shown in the admin menu.
How It Works
WordPress fires the use_block_editor_for_post_type filter whenever it needs to determine which editor to load for a given post type. The filter receives two arguments: a boolean $use representing the current decision, and a string $post_type with the post type slug.
The snippet checks whether the post type is in your disabled list using in_array() with strict comparison (true as the third argument) to avoid loose type matching. If it matches, the filter returns false, use the classic editor. If it doesn’t match, it passes the original $use value through unchanged, so other filters in the chain can still modify the decision if needed.
The 10, 2 at the end of add_filter sets the standard priority and tells WordPress the callback accepts two parameters. Both are required, without the 2, WordPress would only pass $use and $post_type would be empty.
Inverting the Logic
If you want Gutenberg active only on specific post types and disabled everywhere else, you can invert the approach. Define an $enabled array instead and return false for any post type not in it. This is useful on sites where you want to lock Gutenberg to posts and pages only, regardless of what future plugins register.
Front-End Impact
This filter only affects the editing interface, it has no impact on how content is rendered on the front end. Posts previously created with the block editor will continue to display their block markup correctly even after Gutenberg is disabled for that post type. The change is purely administrative.
Compatibility
This works independently of the Classic Editor plugin. If you have the Classic Editor plugin installed, it applies its own global or per-post-type overrides that may interact with this filter. If you only need to disable Gutenberg for specific post types, this snippet alone is sufficient and the Classic Editor plugin is not required.
add_filter( 'use_block_editor_for_post_type', function( $use, $post_type ) {
$disabled = [
'portfolio',
'testimonial',
'team_member',
];
return in_array( $post_type, $disabled, true ) ? false : $use;
}, 10, 2 );
