gutenberg editor

How to Prepare Your Plugins for WordPress Gutenberg

Gutenberg is a brand-new editing interface that will change the way people use WordPress. Are you ready for that change? If you’re a plugin developer, you need to prepare your own plugins for Gutenberg. 

In case you haven’t yet heard about Gutenberg, it is a new WordPress editor that will change how you write content. Under Gutenberg, set to become part of WordPress core in version 5, each element in your content will be a block (of type paragraph, image, blockquote, heading, and so on).

Heading block in WordPress Gutenberg

Even metaboxes won’t be the same. 

Simple metaboxes should work with Gutenberg out of the box, although they will be displayed differently. However, if you have complex metaboxes such as the one in the Yoast SEO plugin, then you’ll have to test it against Gutenberg and maybe create a new one just for Gutenberg.

So which plugins need updating for Gutenberg? Plugins with:

  • custom post types
  • complex metaboxes
  • shortcodes
  • or editor features

There are two approaches that we can take as plugin developers: support Gutenberg or disable Gutenberg. Supporting Gutenberg would mean that we will put extra effort into refactoring our code (maybe even duplicating some) so that our plugin users won’t have any difficulty using it.

How to Disable Gutenberg

If we decide to not support Gutenberg, then we need to disable Gutenberg. We can disable Gutenberg completely or only where our plugin is being used. In this section, I will take my own plugin “Simple Giveaways” that has a custom post type and also metaboxes.

Disabling Gutenberg Completely

This is something I would not recommend doing from your plugin. Instead, you might want to inform your plugin users with an admin notice that your plugin doesn’t work with Gutenberg so that they can revert back to the Classic Editor.

Reverting can be done by installing the plugin Classic Editor. Or you may create a new setting for your plugin and do this to disable it:

Powered by WPeMatico

Leave a Comment

Scroll to Top