HowTo:Optimize Your Tag Page Title - Simple Tagging Plugin
I’ve noticed when I installed the Simple Tagging Plugin that the WordPress can’t find a title to the tag search results page(tag page), so it`s just putting “- Enblogopedia”.
Is This Bad?
Well, having a lot of pages with the same page title isn’t a good thing, and it`ll obviously affect your tag pages position in SERPs.
Hopefully, Michael Woehrer has a lot of useful functions within his plugin that can be used to change the title of the Tag page.
For this, we`ll use two functions:STP_GetCurrentTagSet() and STP_IsTagView().
More about these functions can be found here. Just as follows:
The template tag <?php STP_CurrentTagSet(); ?> outputs the tags used in a tag search, that means it displays the current tags when a visitor is browsing tags.
The template tag STP_IsTagView() can be used to determine if the current view will be returning tag search results. It returns TRUE if a tag search was requested (that means that a visitor is browsing tags), FALSE otherwise.
Here`re what you need to do.
First, edit your header.php file and replace the <title> tag as the following:
<title><?php if(function_exists('STP_IsTagView') && STP_IsTagView()) { STP_CurrentTagSet();} else { bloginfo('name'); wp_title();} ?></title>
This way, if the plugin is activated and your are in the Tag page, your page title will show the tag as title. You can have a lot of forms of this code, such as:
<title><?php if(function_exists('STP_IsTagView') && STP_IsTagView()) { STP_CurrentTagSet(); echo ' - '; bloginfo('name');} else { bloginfo('name'); wp_title();} ?></title>
Or replacing STP_CurrentTagSet(); echo ‘ - ‘; bloginfo(’name’); with echo ‘Search Results for ‘; STP_CurrentTagSet();.
Or if you have a long blog name, just like mine, as I`m using “Blogging Encyclopedia - Enblogopedia“. And I`m also using the SEO Title Tag plugin. My code looks like:
<title><?php if(function_exists('STP_IsTagView') && STP_IsTagView()) { STP_CurrentTagSet(); echo ' - Enblogopedia';} else { if (function_exists('seo_title_tag')) { seo_title_tag(); } else { bloginfo('name'); wp_title();}} ?></title>
So it`s really depend on your current Title tag, the easiest way is just to put the current title tag inside the else {} statement. This way, whenever you are not in a tag page it`ll show up your default(current) title tag.
For more questions, feel free to drop a comment anytime
Enjoyed the article?! Then subscribe to Enblogopedia now!
Related Entries
- Quick Links 25-02-2007
- Successfully Upgraded To WordPress 2.1.1
- How To Optimize Your Titles For SE?
- Plugin Review:WP-Table Creating Tables Can’t Be Easier!
Comments
6 Responses to “HowTo:Optimize Your Tag Page Title - Simple Tagging Plugin”
:: Trackbacks/Pingbacks ::


Thank you. I was looking for this solution!
You are very welcome.
I have a small problem with simpletagging plugin.
When i go to individual “tag pages”, the blog posts are displayed in full. i dont want to show full posts on those pages. i just want to show two-three lines of each article. how do i do it?
plz help.
I was also looking for this solution and worked pretty good. The only thing I would like to be able to is to 1) Have tags in the title show in “Title Case” 2) Be able to add text around (before and maybe after) the “tag” in the title.
Hi
Sorry Vinit, I was(and still) too busy so I can’t keep up with my blogs in the mean time :S
anyway, to do that you need to edit your “pagetemplate.simpletagging.php” page and replace the function “the_content” with “the_excerpt”, I believe this would do the job.
@Matt: I really don’t understand your first question, please clarify.
For the second question, I already explained it, just see the last code I mentioned in the post and all will be come clear, you just have to “echo” whatever you want before or after the “STP_CurrentTagSet” function and it’ll appear just like ” - Enblogopedia”…
if you have more questions feel free to ask..