🧠 What’s the Problem?
By default, WordPress uses the Gutenberg (Block) Editor for all post types that support it. But what if:
- You only want Gutenberg for blog posts
- Or you want to use the Classic Editor for a custom post type (CPT)
You don’t have to disable Gutenberg site-wide — you can disable it only for specific post types. Here’s how.
🎯 Goal
Let’s disable Gutenberg (block editor) for a custom post type named projects, while keeping it enabled for all others.
🧩 Step-by-Step Guide
Step 1: Use the use_block_editor_for_post_type Filter
Add this code to your functions.php file or a custom plugin:
function disable_gutenberg_for_projects($is_enabled, $post_type) {
if ($post_type === 'projects') {
return false; // Disable Gutenberg
}
return $is_enabled; // Keep Gutenberg for others
}
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_for_projects', 10, 2);
💡 Replace 'projects' with the slug of your custom post type.
Optional: Disable for Pages or Other Core Types
Here’s how you’d disable Gutenberg for Pages too:
if ($post_type === 'page' || $post_type === 'projects') {
📌 Bonus: Want to Disable for Specific Post IDs?
Use this if you want to disable Gutenberg only for certain posts:
function disable_gutenberg_for_specific_posts($is_enabled, $post_type) {
$disable_ids = [12, 45, 77]; // Add your post IDs here
if (is_admin() && in_array(get_the_ID(), $disable_ids)) {
return false;
}
return $is_enabled;
}
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_for_specific_posts', 10, 2);
⚠️ Note: This approach requires that get_the_ID() returns the correct post ID — may need adjustment depending on context.
🛠️ Alternative: Use Classic Editor Plugin (with Config)
If you’re already using the Classic Editor plugin, you can choose per-post-type behavior via:
- Settings → Writing
- Set “Allow users to switch editors” = No
- Set “Default editor for all users” = Classic
But the code method is cleaner if you want full control.
✅ Summary
- ✅ Gutenberg can be disabled selectively
- ✅ Use
use_block_editor_for_post_typefilter - ✅ Great for legacy content, CPTs, or plugin-based editors like ACF or Elementor
This approach keeps your WordPress environment clean and avoids unnecessary plugin bloat — all while giving you the editing experience you need, where you need it.
Need help fixing this on your website?
Need help fixing this on your website? Chat with me on WhatsApp.
