Monday, December 10, 2018
Tips

Remove and disable Gutenberg

Do you have compatibility issues with Gutenberg?

This week I receive an alert that the WordPress 5.0 update has been scheduled to November 19. This new version includes a totally renewed editor called Gutenberg that will renew the way we write the content in our blogs.

f your plugin interacts with the editor screen in any way, we urge you to test with the 5.0 branch as soon as possible. Shortcodes—both block (i.e. on their own line) and inline—will continue to work, as will embeds. Similarly, Meta Boxes are still supported; however, they may not look the way you expect.

This means that a lot of sites will become to start having some compatibility issues as they have been built without the new Gutenberg editor.

Many users have put the scream in the sky due to this compatibility issues but the update has been addressed and basically, we have two options: invest a lot of time to test and fix the Gutenberg compatibility issues or disable Gutenberg.

Plugin: Disable Gutenberg

The first method we will explain to disable Gutenberg in WordPress is the easiest. Like everything in WordPress, there’s always a plugin to do the stuff.

This plugin called Disable Gutenberg allows you to disable the new editor and restore the default WordPress editor.

Disable Gutenberg

Code: Disable Gutenberg

If you are a developer and don’t like the method, or you need to disable Gutenberg in one of your projects, here we will share some code snippets that you can include in the functions.php file.

Disable Gutenberg

The code above allows you to disable the Gutenberg editor in the entire site. This means it will be removed from all post types and pages.

Custom Post Types

If you want to remove the Gutenberg editor in some specific post type we can use the same filter and create a function to return a false value according to the current post type.

If you’re creating a custom post type the WordPress you can disable Gutenberg by disabling the REST API, which required the editor.

To do this we will set to false the show_in_rest

Meta Boxes

The Gutenberg editor is also included in the metaboxes that include a text editor. This could be totally unnecessary in most cases and if you’re a plugin developer you probably will require a method to remove the Gutenberg editor from Metaboxes

Leave a Reply