Open functions.php in wordpress theme directory folder inside wp-content->themes->theme name folder then copy and paste the code below inside functions.php
function change_search_url() {
if ( is_search() && ! empty( $_GET['s'] ) ) {
wp_redirect( home_url("/search/" ) . urlencode( get_query_var( 's' ) ) );
exit();
}
}
add_action( 'template_redirect', 'change_search_url' );
Watch the tutorial in YouTube
Support WeHelpCode by subscribing to our YouTube Channel