Disabling the Gutenberg Editor in WordPress 5

Disabling the Gutenberg Editor in WordPress 5
Published: by
Last updated:
Categories
WordPress

Most WordPress users are happy with regular updates on their favourite content management website software. For me, a striking difference, starting at WordPress 5, was the Gutenberg Editor instead of the, now, ‘Classic Editor’. Without going into too much of a discussion, this post will show how to disable the Gutenberg Editor.

This is an ongoing post. Please suggest corrections, explanations, etc. in the comment section at the bottom of this page.

The, now default, Gutenberg Editor (replacing the TinyMCE aka the ‘Classic Editor’) is said to pave the way forward for WordPress in more ways than just a WordPress editor. With its block layout (hence ‘Block Editor’), Gutenberg is paving the way for page templates by turning WordPress into a full site customiser. This sounds very exciting for the future of WordPress and will make layouts easier for new websites (and new users).

Even so, Gutenberg is still in its early development and there are still a lot of issues that need to be addressed. Not everyone is a fan of Gutenberg (maybe, yet). Fortunately, the Classic Editor is still available for the time being (said to be until 31 December 2021).

Disable the Gutenberg Editor using the functions.php

For established WordPress users, the simplest, and cleanest, way to disable the Gutenberg Editor (and continue using the Classic Editor) is by adding the following pieces of code to the (Child) Theme’s functions.php file:

// Disable Gutenberg Editor
add_filter( 'use_block_editor_for_post', '__return_false' );
add_filter( 'use_block_editor_for_post_type', '__return_false' );

To start off, the Gutenberg Editor can be disabled by filtering '__return_false' through the use_block_editor_for_post and use_block_editor_for_post_type functions.

In my experience, the code above is the minimum that is required to disable the Gutenberg Editor and will get rid of the elephant in the room. Even if this is so, more thorough developers will still notice the block editor CSS library stylesheets situated in the <head> section of page requests:

<link rel="stylesheet" id="wp-block-library-css" href="https://behind-the-scenes.net/wp-includes/css/dist/block-library/style.min.css" type="text/css" media="all">

Some plugins, such as Toolset and WooCommerce, might also add their own block editor stylesheets. To remove the WordPress core block editor CSS library from the <head> section, the following code can be used:

function pre_remove_wp_block_library_css() {
  wp_dequeue_style( 'wp-block-library' ); // WordPress core
  wp_dequeue_style( 'wp-block-library-theme' ); // WordPress core
  wp_dequeue_style( 'wc-block-style' ); // WooCommerce block CSS
  wp_dequeue_style( 'toolset_blocks-style-css' ); // Toolset block CSS
}
add_action( 'wp_enqueue_scripts', 'pre_remove_wp_block_library_css', 100 ); // in some cases a higher priority (e.g.200) is more effective.

Disable the Gutenberg Editor using plugins

For less advanced WordPress users, or a more robust and most up to date solution, the Gutenberg Editor can be disabled using the Classic Editor plugin or the Disable Gutenberg plugin. Both these plugins got good ratings at the time of writing and worked well out of the box.

Classic Editor plugin

WordPress Classic Editor plugin

At the time of writing the Classic Editor plugin had more than 900 000 active installs and an average rating of 4.9 out of 5. Because Gutenberg saves its markup in HTML, you can still roll back to the Classic Editor even after using the Gutenberg Editor.

The Classic Editor plugin can be installed from the WordPress plugins section or downloaded from WordPress.org and extracted or uploaded to the plugins folder. It should start to work immediately after its activation.

Disable Gutenberg plugin

Disable Gutenberg plugin

At the time of writing the Disable Gutenberg plugin had more than 30 000 active installs and an average rating of 5 out of 5. According to its author, this plugin will not expire when TinyMCE support expires for WordPress. In addition to deactivating the Gutenberg Editor, this plugin provides options to enable Gutenberg on specific post types, user roles and more.

The Disable Gutenberg plugin can be installed from the WordPress plugins section or downloaded from WordPress.org and extracted or uploaded to the plugins folder. It should start to work immediately after its activation.

Background

WordPress Gutenberg Editor header
The official WordPress Gutenberg Editor plugin header.

Prior to WordPress 5.0, the Gutenberg Editor was available as a plugin from WordPress.org.

WordPress Gutenberg Editor plugin

Even after all the hype, the plugin wasn’t received well by users, but has a lot of active installs. Looking at the plugin and WordPress correspondence, the future of Gutenberg should be bright – once all the kinks have been sorted out.

About the author
Renier busies himself with improving his English writing, creative web design and his websites, photoshopping, micro-electronics, multiple genres of music, superhero movies and badass series.
Behind the Scenes is a free, informative website. If you find value in any of our content, please consider making a donation to our cause.
Donate via PayPal

Save, share & discuss

Your comment is important, but don't be a knob. Keep it constructive and polite.

Leave a Reply

Your email address will not be published.

More WordPress plugin related posts

Online micro-electronic components, consumables & accessories
Online micro-electronic components, consumables & accessories
17 January 2021
Ad: Buy great value for money micro-electronic components online from BangGood.com. Free international delivery, including to South Africa. More…
Using the Media Library Assistant plugin for WP
Using the Media Library Assistant plugin for WP
5 January 2019
WordPress websites with a large amount of Media content can become overwhelming to manage. With expanding libraries, images and other media can start to disappear in a sea of files which can make finding them very difficult. With the Media Library Assistant plugin for WordPress, searching and organising Media files becomes a breeze. More…
Categories
WordPress
Creating custom social media share buttons for posts
Creating custom social media share buttons for posts
27 October 2017 | Updated 19 March 2019
Website developers might find it necessary to have custom social share buttons at the top/bottom of their web pages. Custom buttons allow better integration with the rest of a website’s style and create a more unique look. More control over where these buttons appear on pages might also be beneficial. More…
Categories
WordPress