I currently have my title template for posts set up like this:
%%title%% · %%category%%
The problem is, one of the categories is something I just use for reference in the site structure (it basically serves as a marker “important”) and isn’t usually displayed to the user. So when I post a topic that’s marked with the “important” category, it displays as something like this: Post title · category 1, “important”.
I have the php code to get rid of the important label using WordPress’s get_the_category function, however I’m not sure whether it’s possible to use that within the WordPress SEO plugin.
A solution I thought of was to clear the title template area for posts in WordPress SEO (theoretically so that nothing about the title tag for posts gets injected in the header) and to insert the needed code in the header manually for posts. However I’m not sure if this would be possible while maintaining the basic title template needed for WordPress SEO in the header.php:
<title><?php wp_title (''); ?></title>.
Would it be possible to add a rule in header.php for post titles using an if function or something of that nature? Is clearing the title tag area in WordPress SEO even a good idea? Or maybe this purpose could be achieved in a more convenient way?
I would be glad if you could share your ideas on this. I really need to get rid of that category in the title tags one way or another.
- The topic ‘Not showing a category in posts title tag?’ is closed to new replies.