RSS

A blog about WordPress for WordPress bloggers.

by Ian Blackford

Title Tags in WordPress Themes

Sat, Jun 20, 2009

WordPress Mini Tips

Title Tags in WordPress Themes

Here is a quick WordPress tip I thought I’d share with you all. It concerns the <title> tag in your WordPress Theme.

Most of them are badly formed in my opinion, so with a little research, cribbing of other peoples ideas and trial and error I think I have found the best title tag arrangement. Open up your ‘header.php’ file from your current theme and replace everything between the opening and ending title tags. The opening tag is:

<title>

And the ending title tag is:

</title>

Once you have found that code (and only that code) replace the whole lot with:

<title>
<?php wp_title(‘ ‘); ?>
<?php if(wp_title(‘ ‘, false)) { echo ‘ -’; } ?>
<?php bloginfo(‘name’); ?>
- <?php bloginfo(‘description’); ?>
</title>

I reckon if you craft your blog name and slogan / description carefully, you can get all your keywords into your title using this.

What are your thoughts?

Like this Article? Subscribe to my RSS feed

This post was written by:

Ian Blackford - who has written 51 posts on bloggingrocket.com.

Ian Blackford is a web developer based in Telford Shropshire and is the owner manager of Design Conscious .com Ian now creates most of his sites using WordPress and so has probably hit most of the snags and problems that everyone hits, who better then to start a blog on how to set up WordPress. Like what you've read? Then please consider giving a donation.

Contact the author

Leave a Reply