Introduction
Since the release of WordPress 5.0, the Gutenberg editor has become the default content editor. While it offers a modern block-based editing experience, many developers and businesses still prefer the simplicity, speed, and control of the Classic Editor.
If Gutenberg doesn’t align with your workflow or introduces unnecessary complexity, you can disable it without installing any plugin. This keeps your website lightweight, secure, and optimized for performance.
This guide walks you through the most effective methods to disable Gutenberg using code.
Why Disable Gutenberg?
Many professionals choose to disable Gutenberg for the following reasons:
- Improved compatibility with older or custom-built themes
- Faster and distraction-free editing experience
- Greater control over HTML and structured layouts
- Reduced plugin conflicts and performance overhead
Method 1: Disable Gutenberg Using Code (Full Control)
You can completely disable Gutenberg by adding the following code to your theme’s functions.php file.
Steps
- Log in to your WordPress dashboard
- Go to Appearance → Theme File Editor
- Open the
functions.phpfile - Add the following code:
// Disable Gutenberg on the back end.
add_filter( 'use_block_editor_for_post', '__return_false' );
// Disable Gutenberg for widgets.
add_filter( 'use_widgets_block_editor', '__return_false' );
add_action( 'wp_enqueue_scripts', function() {
// Remove CSS on the front end.
wp_dequeue_style( 'wp-block-library' );
// Remove Gutenberg theme styles.
wp_dequeue_style( 'wp-block-library-theme' );
// Remove inline global CSS.
wp_dequeue_style( 'global-styles' );
// Remove classic theme compatibility styles.
wp_dequeue_style( 'classic-theme-styles' );
}, 20 );
- Click Update File
What This Code Does
This snippet gives you full control by:
- Disabling Gutenberg editor completely
- Disabling block-based widgets
- Removing unnecessary Gutenberg CSS files
- Improving website speed and performance
Method 2: Disable Gutenberg for Posts Only
If you only want to disable Gutenberg for posts:
add_filter( 'use_block_editor_for_post', '__return_false' );
Method 3: Disable Gutenberg for Specific Post Types
To disable Gutenberg only for pages:
add_filter('use_block_editor_for_post_type', function($enabled, $post_type) {
return $post_type === 'page' ? false : $enabled;
}, 10, 2);
Best Practices Before Editing Code
- Always back up your website before making changes
- Use a child theme to avoid losing changes after updates
- Be cautious when editing
functions.phpto prevent errors
When Should You Keep Gutenberg?
Gutenberg may still be useful if:
- Your theme is built for block editing
- You rely on visual page builders
- You want drag-and-drop flexibility
Conclusion
Disabling Gutenberg without a plugin is a smart and efficient way to streamline your WordPress workflow. It reduces unnecessary bloat, improves performance, and gives you greater control over your content editing experience.
Need Professional WordPress Support?
At Jemoweb Solutions, we build fast, secure, and SEO-optimized WordPress websites designed to drive real business results.
Our Services:
- Web Design & Development
- Website Optimization
- SEO Services
- Ongoing Maintenance & Support
Contact Us:
📞 +254 743 702 300
📞 +254 786 900 109
💬 WhatsApp: +254 743 702 300 / +254 786 900 109
📧 [email protected]







