How to Disable the Gutenberg Editor in WordPress

Learn how to disable the Gutenberg Block Editor using a snippet in WPCodeBox!

Meet WPCodeBox: The Best Code Snippets Plugin for WordPress
faces
Join thousands of developers and agencies who are working better and faster using WPCodeBox

WordPress forces the Gutenberg block editor on every new installation. While powerful for layouts, it complicates simple blog publishing tasks and disrupts established workflows.

While you can install the official Classic Editor plugin, it adds unnecessary weight to your site for a simple toggle. A lightweight snippet handles this switch more efficiently while keeping your site fast.

In this article, I’ll share a copy-paste snippet that’ll restore the Classic Editor globally or for specific post types.

Why You’d Want to Disable the Gutenberg Editor?

Gutenberg turns simple writing into a process of managing endless blocks. This adds unnecessary friction if you prioritize speed over complex layout design. The Classic Editor provides a faster, distraction-free interface for text-heavy content.

The block editor frequently breaks compatibility with older themes and specialized plugins. Many legacy plugins expect a single text area and struggle to display correctly within the block system. Disabling Gutenberg restores the stable backend environment that your existing plugins or theme require.

Gutenberg editor

Gutenberg is also redundant if you already use a page builder like Breakdance or Oxygen. If you keep two separate layout systems active, it creates a confusing interface for you and your clients.

How to Disable Gutenberg Completely

You can restore your Classic Editor globally using a single PHP filter. This method is much cleaner than installing a heavy plugin, as it stops the block editor from loading without adding unnecessary bloat to your site.

<?php 
add_filter('use_block_editor_for_post', '__return_false');

This single line of code instructs WordPress to bypass the block editor for every post, page, or custom post type. Once you activate it, your editing screens immediately revert to the familiar TinyMCE interface.

How to Disable Gutenberg for Specific Post Types

Sometimes you might want to use Gutenberg for blog posts but prefer the Classic Editor for other areas like products or Custom Post Types. If you use a page builder for your pages, the block editor only adds extra complexity you don’t need.

In such cases, you can use this snippet to choose exactly where the block editor should be disabled:

<?php 

// Enable Gutenberg for posts
add_filter('use_block_editor_for_post', '__return_true', 10);

// Disable Gutenberg for pages and other post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);

This function checks the post type before the editor loads. If the post type matches your list, it forces the Classic Editor to load instead. This snippet gives you absolute control and lets you keep modern blocks for your blog while maintaining a clean text interface for your other post types.

Step-by-Step: Adding the Snippet to Your Website

While you can directly add this code snippet to your theme’s functions.php file, editing theme files directly creates ongoing problems. Theme updates overwrite your custom code without warning, while a syntax error can trigger a white screen that locks you out of your admin dashboard.

A snippet plugin eliminates these risks by running your code independently from your theme. WPCodeBox is the best plugin for this use case because it allows you to manage all your PHP, CSS, SCSS, and JavaScript snippets from one organized dashboard.

wpcodebox snippet plugin

It creates a secure execution environment with intelligent error detection that prevents most mistakes from breaking your site. This ensures your modifications stay active even when you switch themes or run updates, making them truly portable and maintenance-free.

WPCodeBox also provides cloud storage to reuse your best snippets across all your sites. It lets you organize code into folders, search a repository of tested scripts, and use a conditional logic builder to control exactly when and where your code runs.

Now that you know why WPCodeBox is the most reliable way to manage your code, let’s look at how to use it to add the Gutenberg snippet:

  1. Start by purchasing and installing WPCodeBox on your WordPress site. Once activated, navigate to WPCodeBox in your admin sidebar menu. This will automatically open the snippet creation interface, where you can add your code.
  2. Name your snippet “Disable Gutenberg Editor” so you can easily identify it in your list later.
  3. Paste the PHP code from the previous section into the code editor and configure these settings in the snippet panel:
    • Type: PHP Snippet
    • How to run the snippet: Always (On Page Load)
    • Where to insert the snippet: Plugins Loaded (Default)
  4. Click the Save button above the editor. WPCodeBox saves your snippet in a disabled state to protect your site from any accidental copy-paste errors.
  5. Review your code one last time to ensure no characters were lost during the process.
  6. Toggle the snippet to Enabled status to activate the Classic Editor immediately across your site.
conditional disable gutenberg editor

Your post type will now use Classic Editor and is safe from future WordPress updates. WPCodeBox ensures this configuration persists even if you change your theme, keeping your workflow consistent and distraction-free.

How to Verify the Classic Editor is Restored

You can verify the change by opening any existing post or clicking “Add New” in the Posts menu. Instead of the block-based Gutenberg interface, you should see the familiar TinyMCE toolbar and a single large text area. This confirms the snippet is successfully overriding the default block editor.

Classic editor page WordPRess pages

If you still see blocks, check that your snippet is enabled in WPCodeBox and clear your site cache. Most changes appear immediately, but some caching systems may require a manual refresh to show the updated admin interface.

More on Disabling Gutenberg Editor

1. How do I disable Gutenberg in WordPress Elementor?

You can disable Gutenberg by adding a global filter that restores the Classic Editor and prevents the block editor from loading on your pages. This ensures that Elementor remains your only primary design plugin. You can also turn off the “Gutenberg” experiments within Elementor’s own internal settings to avoid any overlapping layout features.

2. How do I disable Gutenberg for custom post type in WordPress?

You can disable the block editor for specific post types by using a conditional PHP filter. This approach allows you to keep Gutenberg active for blog posts while forcing the Classic Editor for custom types like Products or Portfolio.

add_filter('use_block_editor_for_post_type', function($enabled, $post_type) {
    return ($post_type === 'your_post_type') ? false : $enabled;
}, 10, 2);

3. How do I disable the classic editor in WordPress?

WordPress uses the Gutenberg block editor by default, so you only need to disable the Classic Editor if you have previously installed a plugin or added a code snippet to enable it. Simply deactivate any Classic Editor plugins or remove the PHP filter __return_false from your code manager. This will immediately restore the standard block-based editing experience across your site.

More Ways to Customize Your WordPress Website

Related Tutorials

WPCodeBox is a WordPress Code Snippets Manager that allows you to share your WordPress Code Snippets across your sites.