Use the classic editor in WordPress without a plugin
Switch off the block editor and go back to the classic editor with two lines of code. Here is what the Snipfire snippet does the same as the Classic Editor plugin, and what it doesn't.
What Classic Editor does
The official Classic Editor plugin brings back the classic Edit Post screen and lets administrators choose which editor people use. The plugin on WordPress.org
What the snippet does the same
- Posts, pages and custom post types open in the classic editor instead of the block editor.
- Old-style meta boxes and plugins that depend on the classic screen work again.
- The Widgets screen is not affected by either. For that, use the Classic widgets snippet.
What's different
- The plugin has settings: a default editor for all users, and an option to let users switch between editors. The snippet has no settings.
- With the plugin, each post can remember which editor it was last edited in. The snippet uses the classic editor for every post, for every user.
When to keep the plugin Keep the plugin if some users or some posts still need the block editor.
The snippet: Use the classic editor
Posts and pages open in the classic editor instead of the block editor, as with the Classic Editor plugin.
<?php
add_filter( 'use_block_editor_for_post', '__return_false', 100 );
add_filter( 'use_block_editor_for_post_type', '__return_false', 100 );
Notes, where it runs and what it was tested with
Switching from the plugin
- Install the snippet in Snipfire (it arrives switched off).
- Deactivate Classic Editor.
- Switch the snippet on. Snipfire checks the code and test-loads your site first.
- Check the page it affects, then delete the plugin.