@replace {{title}}, {{text}}
// Set a custom title for the 404 page
add_filter( 'generate_404_title', function ( $title ) {
return '{{title}}';
} );
// Set custom text for the 404 page
add_filter( 'generate_404_text', function ( $text ) {
return '{{text}}';
} );
// Hide the search form from content area on the 404 page
add_filter( 'get_search_form', function ( $form ) {
if ( is_404() && did_action( 'generate_after_entry_header' ) && ! did_action( 'generate_after_content' ) )
return '';
return $form;
} );