To switch back to the Classic Editor by disabling the Block Editor (Gutenberg), you can use one of the following methods:
Method 1: Use the Classic Editor Plugin
The easiest way to switch back to the Classic Editor is to use the Classic Editor plugin.
- Go to your WordPress admin dashboard.
- Navigate to Plugins > Add New.
- Search for “Classic Editor”.
- Click Install Now and then Activate.
The Classic Editor plugin will automatically disable the Block Editor and revert your site to the classic editing experience.
Method 2: Add Code to functions.php
If you prefer not to use a plugin, you can add code to your theme’s functions.php file to disable the Block Editor.
- Open your theme’s functions.php file (located in wp-content/themes/your-theme/).
- Add the following code to disable the Block Editor:
// Disable Gutenberg editor for posts
add_filter('use_block_editor_for_post', '__return_false', 10);
// Disable Gutenberg editor for post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);
Method 3: Create a Custom Plugin
If you prefer to create a custom plugin to disable the Block Editor, follow these steps:
- Create a new file in your wp-content/plugins/ directory, for example, disable-gutenberg.php.
- Add the following code to the file:
<?php
/*
Plugin Name: Disable Gutenberg
Description: Disables the Gutenberg Block Editor and reverts to the Classic Editor.
Version: 1.0
Author: Your Name
*/
// Disable Gutenberg editor for posts
add_filter('use_block_editor_for_post', '__return_false', 10);
// Disable Gutenberg editor for post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);
3. Activate the plugin from the WordPress admin dashboard.
Optional: Hide the Gutenberg Nag
To hide the nag message that suggests switching to the Block Editor, you can add the following code to your functions.php file or custom plugin:
add_action('admin_init', function() {
remove_action('try_gutenberg_panel', 'wp_try_gutenberg_panel');
});
By following any of these methods, you can disable the Block Editor (Gutenberg) and switch back to the Classic Editor in WordPress.