Different Ways to Disable the Block Editor
Method 1: Using a Plugin (Recommended for Most Users)
The simplest and safest way to disable Gutenberg is by installing the Classic Editor plugin.
Classic Editor Plugin
- Official WordPress plugin
- Over 5 million active installations
- Maintained by WordPress contributors
-
Download Classic Editor
After installation:
- Go to Settings > Writing
- Choose your preferred editor settings
- Save changes
Method 2: Using Code (For Developers)
Add this code to your theme's functions.php or custom plugin:
Completely disable the block editor for all post types:
add_filter('use_block_editor_for_post', '__return_false');
Disable block editor for specific post types:
function disable_gutenberg_for_specific_posts($use_block_editor, $post_type) {
// Add post types where you want to disable Gutenberg
$disabled_post_types = array('post', 'page');
if (in_array($post_type, $disabled_post_types)) {
return false;
}
return $use_block_editor;
}
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_for_specific_posts', 10, 2);
Method 3: Using wp-config.php
Add this line to wp-config.php before the "happy blogging" line:
define('CLASSIC_EDITOR_REPLACE', true);
Best Practices & Security Considerations
-
Plugin Method (Recommended)
- Easier to maintain
- Automatically receives updates
- Includes proper fallback mechanisms
- User-friendly settings interface
-
Code Method (Advanced)
- Use in child theme's functions.php or custom plugin
- Never modify core WordPress files
- Test thoroughly after WordPress updates
- Document your changes
-
wp-config.php Method
- Use only if you're comfortable editing server files
- Back up your site before making changes
- May need adjustment after major WordPress updates
Common Pitfalls to Avoid
- Don't modify core WordPress files
- Don't disable updates thinking it will keep Gutenberg away
- Don't use outdated code snippets from unreliable sources
- Don't forget to test your site after making changes
Additional Tips
- Test your site's functionality after disabling Gutenberg
- Check compatibility with your theme and plugins
- Keep the Classic Editor plugin updated
- Have a backup plan if you need to switch back
Alternative Solutions
-
Disable Gutenberg Plugin
-
Classic Editor Addon
Remember to regularly update your chosen solution to maintain compatibility with WordPress core updates.