InWordPress 4.1 and up, you can set the title tag automatically by adding this snippet to functions.php
.
Remember to remove your own title tag from header.php, and add the wp_head()
hook.
Code Snippet:
function theme_slug_setup() {
add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme', 'theme_slug_setup' );