How to disable Gutenberg Editor without a Plugin

Since ever Gutenberg was made part of the core WordPress, I have been pulling my hair like you. Even before that when it was in beta, and was offered as a plugin it had gotten a measly 2.5 rating stars. Yet the WordPress Team went on to make it the part of the core.

There are a couple of plugins, that can disable the Gutenberg editor for you, and bring back the old Editor, however I am never in favor of using a plugin what a single line of code can do for you. Simply put either of these lines of code in your themes’ functions.php file.

// disable for posts
add_filter('use_block_editor_for_post', '__return_false', 10);

// disable for post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);

Phew! It would disable the Gutenberg, and bring back the Old Editor and things will go on as normal as they did before.

Monday, February 11, 2019