0

In my wordpress website Site title and Tag line (Both are) shown on the place of title tag. I want to show only title tag. What can i do now. Please help me.

Please check the picture: meta Title and meta Tag both show on browser bar Please check my site by your browser. And put mouse cursor on the top of the browser.

My Site: http://songspkdj.com/

Advance Thanks for help.

0

You can use the wp_title filter to change your title to whatever you want.

add_filter( 'wp_title', 'my_title', 10, 2 );
function my_title( $title, $sep ) {
    global $page, $paged;
    if ( is_feed() )
        return $title;
    // Add the site title to the page's title
    $title .= get_bloginfo( 'name' );
    // Add the tagline to homepage (remove the 3 below lines if you don't need)
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        $title .= " $sep $site_description";
    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
        $title .= " $sep " . sprintf( __( 'Page %s', 'text-domain' ), max( $paged, $page ) );
    return $title;
}

The above code will update your blog's title depending on where you are at the moment.

Please notice, your theme has to support the title tag. If it does not, you should add the support by using add_theme_support( 'title-tag' ); in your theme's functions.php file.

Feel free to change the above code and add / remove the parts you would like to see or hide.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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