0

I developed my theme. and I set header.php.

And in Header.php, I set like this.

<title>My Site Name</title>

This makes search-engine confuse. Every page and posts title in head tag are same with site-name.

Do you have tips to set the title and meta tag for SEO?

2 Answers 2

3

To properly set the title tag in a theme you shouldn't put it in header.php manually. Your header.php should have wp_head() somewhere between <head></head>, then you can let WordPress set the title tag by adding support for title-tag to your theme:

function wpse_304818_theme_setup() {
    add_theme_support( 'title-tag' );
}
add_action( 'after_setup_theme', 'wpse_304818_theme_setup' );
0
0

You need to follow steps to add support for title tag as mentioned in the answer by @Jacob Peattie

If still, you want additional option to add SEO specific title and meta description, you can use Yoast SEO WordPress plugin, which provides additional custom fields to add the page title and meta description.

Yoast SEO: https://wordpress.org/plugins/wordpress-seo/

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.