4

As the 5.0 is getting real, and so is Gutenberg...

Is it possible to disable Gutenberg and use previous TinyMCE editor?

How to do this?

2
  • 1
    No need to make things bulky by custom code change. When you use Gutenberg, you also get a toggle feature(backward compatibility). On hover of each post, you would see the link “Classic editor” which lets you go back to classic editor. - Achin Dec 5, 2018 at 20:53
  • 3
    wordpress.org/plugins/classic-editor This plugin allows you to disable it entirely, or you have an option to use either the classic editor or the new editor on a per post basis.
    – Otto
    Dec 5, 2018 at 20:58

4 Answers 4

5

Yes, you can disable it.

You can do this with code

If you want to disable it globally, you can use this code:

if ( version_compare($GLOBALS['wp_version'], '5.0-beta', '>') ) {
    // WP > 5 beta
    add_filter( 'use_block_editor_for_post_type', '__return_false', 100 );
} else {
    // WP < 5 beta
    add_filter( 'gutenberg_can_edit_post_type', '__return_false' );
}

And if you want to disable it only for given post type, you can use:

function my_disable_gutenberg_for_post_type( $is_enabled, $post_type ) {
    if ( 'page' == $post_type ) {  // disable for pages, change 'page' to you CPT slug
        return false;
    }

    return $is_enabled;
}
if ( version_compare($GLOBALS['wp_version'], '5.0-beta', '>') ) {
    // WP > 5 beta
    add_filter( 'use_block_editor_for_post_type', 'my_disable_gutenberg_for_post_type', 10, 2 );
} else {
    // WP < 5 beta
    add_filter( 'gutenberg_can_edit_post_type', 'my_disable_gutenberg_for_post_type', 10, 2 );
}

PS. If you don't want to support older versions, you can ignore filters beginning with 'gutenberg_', so no version checking is needed in such case.

Or using one of existing plugins

  1. Classic Editor
  2. Disable Gutenberg
  3. Guten Free Options
  4. Gutenberg Ramp
3
  • 1
    Should be an option in the settings when WordPress 5 is launched. To choose between classic and block (Gutenberg) editor. Dec 5, 2018 at 14:29
  • @AndréKelling totally agree Dec 5, 2018 at 15:03
  • 1
    @AndréKelling -- Looks like there isn't one. We're being told what to use.
    – Bangkokian
    Dec 13, 2018 at 17:12
2

Generally the answer is no. Gutenberg stores content in a different format than how the pre 5.0 editor did. YMMV significantly if you try to disable gutenberg after content was already created, things might work for core blocks, but blocks created by plugins, who knows.

Now if the question is about disabling before having any content edited in gutenberg, then you have a better chance with the other answers, but this is going to be a short term bandaid fix and is not a long term proper strategy. In the long term all those options are not going to be tested against or just bit rot. And on top of that you might have a limited selection of themes and plugins you can work with.

5.0 have already hard coded gutenberging of sample content. you are not going to escape the need to use it by hacks.

If you want to use WordPress you should embrace its core features, and you do not want to build technical debt and be forced to migrate to gutenberg on a rush. It is better to just do it once it stabilizes and get done with it.

If you do not want to embrace WordPress core features, why do you use it?

9
  • 2
    It’s not exactly true with the different format. Content is still stored in post_content, and is saved as HTML. Of course you won’t be able to edit that content the same way (unless you used dynamic blocks), but it will be possible. Gutenberg stores it’s metadata as comments, so it won’t break anything. Dec 6, 2018 at 6:06
  • of course it is different, in "old" html comments are not significant and with "new" they are, and this is just the most obvious difference.Next in line would be that "old" uses new line as paragraph boundary while "new" directly inserts <p> elements. The fact both formats use the same DB field is the least significaant Dec 6, 2018 at 6:38
  • 1
    In new they are also not significant for rendering posts (unless you use dynamic blocks). Static blocks will display correctly and you’ll be able to edit them as HTML. It’s not a different format - it just adds more meta comments. It’s also not true that comments are insignificant in old editor (you already use some meta comments as more or nextpage) ;) Dec 6, 2018 at 6:43
  • you should try it instead of speculating. try editing something with gutenberg, add an ACF block to the content. Now switch to classic editor and tell me what you see and if you can actually edit it (ok, I am guessing here about how ACF blocks works). Formats are not compatible, this is DB design 101, once the parsing is different you are not compatible any more. Dec 6, 2018 at 6:49
  • 1
    Mark, I’m testing Gutenberg for over 6 months now ;) We’ve also organized a meetup with one of Gutenberg’s devs here in Wroclaw (in May, or even earlier). Please - read carefully - I clearly stated “unless you use dynamic blocks... Dec 6, 2018 at 6:53
2

I just added this in my function.php and it works great

add_filter('use_block_editor_for_post', '__return_false');
1

You can disable Gutenberg by installing the Classic Editor plugin https://wordpress.org/plugins/classic-editor/ This will disable the Gutenberg Editor.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.