Use the Classic Editor for Selected Pages or Templates
Opens specific pages, or pages using certain templates, in the classic editor while everything else keeps the block editor.
Opens WPIDE on
Code
// Post or page IDs that open in the classic editor.
$wpide_classic_editor_ids = array( 0 );
// Page template file names that open in the classic editor.
$wpide_classic_editor_templates = array( 'template-legacy.php' );
add_filter( 'use_block_editor_for_post', function ( $use, $post ) use ( $wpide_classic_editor_ids, $wpide_classic_editor_templates ) {
if ( ! $post ) {
return $use;
}
if ( in_array( (int) $post->ID, array_map( 'absint', $wpide_classic_editor_ids ), true ) ) {
return false;
}
$template = get_page_template_slug( $post );
if ( $template && in_array( $template, $wpide_classic_editor_templates, true ) ) {
return false;
}
return $use;
}, 10, 2 );
Notes
List page IDs and template file names, such as template-legacy.php. Requires the classic editor to be available (it is built in for posts that opt out).
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.