Create Clean Title Tag for your WordPress Posts

One of the easiest things you can do is define a clear and simple Title tag for all of your Blog Posts and implementing this in your Header.php file. You will often want to override whatever theme default is being set and in many cases by doing this manually you can avoid the overhead of adding another WordPress plug-in that just adds a custom title tag to your blog post. The ‘Title’ tag is the name that your post displays at the top of the browser when the page is visited, and it also is the “Title” of your article that gets picked up and displayed on Google Search engines:

Typically what you want to do is keep your title clean, any blog themes will have || or >> characters as part of the Title tag which don’t translate well and provide no SEO value, they also interfere with your ability to submit your articles cleanly to sites like BlogEngage, Digg or other directories.

I decided to make my own custom Title tag in my blogs and simply use this line of text inserted into my Header.php after the <head> tag:

<title><?php if ( is_single() ) { echo wp_title(“”,true) . ‘ on ‘ . get_bloginfo(‘name’); } else { echo get_bloginfo(‘name’) . ‘ for ‘ . get_bloginfo(‘description’); } ?></title>

What the above code will do is set your Title tag to just be your “post title” if it is  apost, and if it is  your homepage or archive, search or any other page, it will use your blog name for <blog description>

so for DragonBlogger.com you can see my title for my homepage becomes:
Dragon Blogger for Blogging Tips, Technology news, with Movie Reviews and Entertainment posts mixed in for fun.

and my posts themselves have a title of just the “post name” on “Dragon Blogger”

I like having my blog name/handle in the title of all posts so users who search for articles can see my identity and handle in the title, or else they may not easily know which site the article is located on.  This is a matter of preference but in my opinion you should make it as easy as possible to identify which site or who the article is attributed to on Google search results.

This code is easily modified and you can use it for just about any blog theme, just remember to backup your existing header.php first and then replace your original <title> tag in your theme with this tag above.  You can tailor it if you need to, but this is a good alternative to using a WordPress plug-in.

-Dragon Blogger

Justin Germino
I have been obsessed with computers, tech, gadgets and games since the early 1980's having grown up on the Commodore 64 and Amiga computers. By day I work in the IT Security Industry and have been in IT for over 20 years. On my spare time I am a Vlogger, Blogger, Streamer, Gadget Reviewer, affiliate marketer, influencer and entertainer. I am also an avid movie fan, TV Show fan, Anime fan, video game fan and fan of trying anything and everything new.
Justin Germino

@dragonblogger

Content Creator/Owner of https://t.co/iWP6afuOc9 for Tech, Game, Entertainment and streamer at https://t.co/594fXMdMIA
We are still going strong on stream. Come chill with us while we are playing Sea of Thieves https://t.co/U4GTcomuxm - 5 hours ago
Justin Germino
Justin Germino
Share Feedback We Want to Hear From You