Change the output of wp_title()

I use wp_title to generate some kind of breadcrumb and it works well, but in there I have the title of the site, and I want to delete that. It looks like this:

Taxonomy1: City | Title of the site. I get that by using <?php wp_title(); ?>.

Read More

How can I delete the title of the site in that output?

Related posts

3 comments

  1. Take a look in header.php of your theme. Some themes have the title output like this:

    <title><?php wp_title('|', true, 'right'); ?> | <?php echo get_bloginfo('name') ?></title>
    

    So you’ll have to remove the | <?php echo get_bloginfo('name') ?> part.

    However you should keep the title of the site in the <title> for SEO purposes.

  2. There is probably a third-party filter running on the wp_title. Remove it before you call the function:

    remove_all_filters( 'wp_title' );
    wp_title();
    
  3. You could use a plugin like WordPress SEO by Yoast and set templates for so if your title tags. You would then have the ability to override your templates at the post/page/category level

Comments are closed.