Usage of wp_title()
is not recommended anymore. Instead, you can add the title-tag
support to your theme, so WordPress can automatically build and output the proper title for you. Here’s how to do it:
add_action( 'after_setup_theme', 'wpse302145_add_title_tag' );
function wpse302145_add_title_tag() {
add_theme_support( 'title-tag' );
}
This piece of code goes in your theme/child-theme’s functions.php
file. You can safely remove the <title><?php wp_title('|', true, 'right'); ?></title>
line from the theme’s header now.