Update (November 8, 2018)
The previous version of this post used
gutenberg_can_edit_post_type. WordPress 5.0 has renamed this to
use_block_editor_for_post_type so the code-name “Gutenberg” isn’t used in core. I’ve updated the post below accordingly.
It can be relatively straightforward to make your simple content pages ready for Gutenberg, but complex pages are different.
Consider a modular homepage that’s built completely with metaboxes. While you could build many custom blocks to implement this (as I’ve done on my homepage), it might be easier and faster to use the tools you already know.
Using a plugin
The Classic Editor plugin is a good place to start. It gives you two options:
- Use the Gutenberg editor by default, and add an additional “Edit (Classic)” link (screenshot). You have to hope the client uses the correct editor for your custom pages.
- Replace Gutenberg site-wide with the old TinyMCE editor. This is less confusing for the client, but they never get to use the new editor anywhere. I don’t think this is a good long-term option, but if you’d like to use it, go to Settings > Writing and uncheck “Do not replace the editor”.
You can use the Gutenberg Ramp plugin to disable Gutenberg on a per-post-type basis. You could use Gutenberg for posts, but keep the classic editor for pages.
Using a filter
We can use the
use_block_editor_for_post_type filter for more fine-grained control. It passes two parameters:
$can_edit, boolean, whether Gutenberg should be used to edit
$_GET['post'] to get the current Page ID from the URL. If that page is using certain templates, I’ll disable the Gutenberg editor. I also use a similar function to remove the classic editor for current WordPress installs.