Disable Gutenberg Editor in WordPress using a Simple Snippet

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

The Gutenberg block editor is enabled by default in WordPress, but not everyone prefers it. If you want to go back to the classic editor, you can disable the Gutenberg editor with just one simple line of PHP using WPCodeBox.

With a single snippet, you attach a filter that tells WordPress to return false when checking whether to use the block editor. Once saved and enabled, all posts open in the classic editor instead of Gutenberg. It’s quick, clean, and requires no extra plugins.

Below is the code snippet from the video used to disable the Gutenberg editor:

<?php 

// Disable Gutenberg for posts
add_filter('use_block_editor_for_post', '__return_false', 10);

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

Related Tutorials

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