The wp_title-generated <title>
in my custom taxonomy archive pages contains the singular taxonomy name with a colon. I can’t figure out where this is coming from (or if it’s default WordPress behavior), and I’d like to remove it. For example, in the archive page for the term ‘Vanilla’ in a taxonomy called ‘Flavors’, the <title>
is
Flavor: Vanilla | My Site Name
What I would like the title to be is simply
Vanilla | My site name
The code in header.php is this:
<title><?php wp_title('|', true, 'right'); ?></title>
There’s only one function in functions.php that’s hooked into wp_title, and it looks unrelated to the Taxonomy name. I can’t figure out where this is coming from or how to remove it.
How can I remove this?
(The answer in How to remove parent taxonomy name from the title generated by wp_title()? is not generalizable to this, and I’m guessing there’s a more direct way to do it.)
Use
wp_title
filter to control outputI’d recommend you use a SEO plugin to take control of all of your titles. WordPress SEO by Yoast is very good.
Or you could add a filter to
wp_title
to change the output.