I know that almost everyone probably has some SEO plugin or package that already replaces the title per post, but I got this request from Katie because her SEO package for some reason or another did not have custom titles. She didn’t want to change the SEO plugin to a different one, since it was already established. She asked if I could write a plugin for this, but lo behold, it was as easy as customizing your header.php file in your theme. Granted, every time you change your theme, you will need to edit your header file, however, it’s so easy, it’s not even funny. Here’s the code segment, and the documentation is within the comments.
/*
* Custom title for Katie. Make sure you have a custom field in your
* posts called "title" in order for the
* custom title to show up. Replace the line:
* wp_title( '|', true, 'right' );
* with everything within the Custom Title code. It's that easy.
*/
$custom_title = get_post_meta($wp_query->post->ID, 'title', true);
if (empty($custom_title)) {
wp_title( '|', true, 'right' );
} else {
echo $custom_title . " | ";
}
// END Custom Title Code
Thanks for rating this! Now tell the world how you feel via Twitter.
How does this post make you feel?
- Excited
- Fascinated
- Amused
- Bored
- Sad
- Angry










