Changing your meta title tag in wordpress

The default way that WordPress displays your page/post/comment/tag pages title is to have the blog name, followed by two >> marks and then the post title, tag title, comment title, or just the blog name if it is the home page. Here is how to do some simple optimisation (ok ok optimization just for you Americans) on your WordPress site or Blog.

As you can see, on this blog things are a little different.  The home page displays the blog name “SEO Training” and also the site description (small text below the blog title).

On the other pages I have made the blog name go to the right.  Why?  because it is better to have the more important keywords near the beginning of the title for SEO.  This is particularly true when the blog title is repeated on every page as it is in this case.

This is another issue.  Should I have the blog title showing on every page?  Jury is out on that one here… so I’m experimenting.  Another blog I write on my home site about online marketing does not have the blog title on every page. If it is a tag page then the page title will be just the tag.  If it is an article then just the article title will appear in the meta title tag.  The blog is new, so I will give it six months and see if I can notice any discernable difference in performance.

Anyway, I digress a bit. Here is how to change your title tag in wordpress.

  1. You need to open the header.php file in whatever theme you are using.  You can do this directly from WordPress, by clicking on the appearance menu item on the left of your WordPress dashboard and then clicking on Editor which will show up below it.  Once you are in editor you can select Header (header.php) from the list of pages on the right.  Your files must be writable though or it will tell you it could not save your changes.  Alternatively, if like me you prefer to use ftp, then the path is wp-content -> themes -> (whatever theme you are using) -> header.php.
  2. Find the title tag. It will look like this: <title><?php wp_title(‘&laquo;’, true, ‘right’); ?> <?php bloginfo(‘name’); ?></title>
  3. Change it to this: <title><?php if ( is_single() || is_page() || is_tag() || is_category()) {  wp_title(‘&raquo;’,true,’right’); bloginfo(‘name’);} else {
    bloginfo(‘name’); echo ” &raquo; “; bloginfo(‘description’);
    } ?></title>
  4. Save it.  You’re done!

If you would like the blog title not to appear on every post then you want to use this instead: <title><?php if(wp_title(‘&laquo;’,false, ‘right’)){wp_title(false);} else { bloginfo(‘name’); echo ‘ &raquo; ‘; bloginfo(‘description’);} ?></title>

That is all there is to it. Better SEO for your WordPress site and it’s not even difficult! Enjoy!

About Ian Wortley


Ian is one of Irelands leading SEO consultants with over 8 years experience in the Irish market. Ian discovered his love of all things internet related in 2005 and has been living nearly exclusively online since then, causing much worry to friends and family, but getting great results for clients. Contact Ian: Phone: 01 6854806 Mobile: 086 3817149

One thought on “Changing your meta title tag in wordpress

  1. I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success.

Comments are closed.