Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

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
<?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

  1. Install the snippet in Snipfire (it arrives switched off).
  2. Deactivate Classic Editor.
  3. Switch the snippet on. Snipfire checks the code and test-loads your site first.
  4. Check the page it affects, then delete the plugin.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.