How to Disable the Gutenberg Editor
While some users prefer to optimize the Gutenberg (block) editor, others may wish to disable it entirely and revert to the classic editor. This can be achieved without a plugin using a simple code snippet.
Disable Code
Add the following line to the end of your active theme's functions.php file:
add_filter('use_block_editor_for_post', '__return_false');
Code Explanation:
add_filter: A WordPress function to hook a callback into a filter.use_block_editor_for_post: The filter hook that controls whether the block editor is used for a post.__return_false: A WordPress helper function that returnsfalse. Using it here disables the block editor for all posts.
Important Notes
- This method globally disables the Gutenberg editor for all posts and pages, restoring the classic editor.
- Always back up your
functions.phpfile before making changes. - If using a child theme, add the code there. If not, consider creating a child theme to prevent code loss during parent theme updates.
- After adding the code, the classic editor will appear when creating or editing posts.