SUBSCRIBE ::

SEO for WordPress Blog – Titles and Meta Tags


Aug 8th, 2007 | Category: SEO Optimization
Share |

Very cool and usefull plugins for your blog SEO that will Optimize your blog posts and pages for better Search. I just started using this and it is great and Free.

If you care about optimizing your WordPress blog pages for maximum search engine results, there are two plugins and a bit of PHP magic which will make your site optimally friendly for SEO.

The plugins involved are Optimal Title from Aaron Schaefer, and Jerome’s Keywords from Jerome Lavigne.

The challenge

Your webpage titles (contained in the <title> ... </title> html tag) should be descriptive of the page content and contain the important keywords you hope to be found for when people search at Google, Yahoo! or other search engines. It’s also generally accepted that adding the Meta tags for Keywords and Description will usually help search engine spiders/robots when indexing your pages, though there are no standard rules for which search engine cares about (if they use them at all) which, and how much importance they place on those page elements. I like to include them everywhere since it doesn’t take much time and can’t hurt.WordPress’s default style for titling your posts is to have the Blog name first followed by the Post or Page title. Unfortunately, the important keywords are in the title of your posts so the title needs to be up front. The Optimal Title plugin takes care of reversing the default naming scheme and is an easy modification to your theme’s header template. Here’s an example from my theme’s header.php file:

<title><?php optimal_title('»'); ?></title>

Pass Optimal Title a character or string to use in separating the name of the Post from the blog name. Now instead of:

SEO Optimization Blog » SEO for WordPress Blog – Titles and Meta Tags

the page title becomes:

SEO for WordPress Blog – Titles and Meta Tags»SEO Optimization Blog

Adding Meta Keywords and Descriptions

Jerome’s Keywords plugin ads a field to WordPress editing form for you to enter your custome keywords to a post. As long as you get into the habit of entering this extra information, you can make them appear on each Post’s page in the <meta name=”keywords” content=”…” /> header tag. The plug-in provides a variety of PHP functions for getting a post’s keywords and also automatically ads the proper Technorati tags to your Atom feeds (normally Technorati only indexes the categories of a post).

Unfortunately, Jerome’s Keywords plugin doesn’t support adding the Meta description tag. This to me is more important than keywords and if you’re in the habit of providing explicit excerpts to your posts (you need to use Advanced Edit Mode when writing your posts), you basically have a good description ready for placement in your headers. To remedy this and avoid having to use a separate plugin just for Meta descriptions, I modified Jerome’s Keywords last weekend to include the following new function:

get_the_description($format_with_tag,$default_desc)

if $format_with_tag = true, it creates the <meta name=”description” content=”…” /> with your post’s description, and you can specify a string as the second parameter which is used if a more specific description cannot be found. The logic for locating a description for any given page roughly follows these rules:

  1. If it’s a Single (post) or Page being served, look first for the custom description field, if not found look for an Excerpt, and finally use the default string passed in if any.
  2. If it’s the home page use any default string passed in, or if none provided, use the blog description
  3. If it’s a category page, it will first use the default you pass it, or if none is provided it resorts to constructing a description from the category description (because of this I have gone back and rewritten all my category descriptions).

In addition to this, in my header template I check to see if we’re loading a page from a local search and in the case construct a description using the search text.

Finally, here’s the code I include into my header template file to handle setting the Title, and Meta Keywords and Description:

1 <?php
2 /* this file is included in the header file using the syntax:
3 * <?php include (TEMPLATEPATH . '/header_stuff.php'); ?>.
4 */
5 $DEFAULT_DESC = (empty($DEFAULT_DESC) ? 'Your Blog Description Here' : $DEFAULT_DESC);
6 ?>
7 <title><?php if(function_exists('optimal_title')) : optimal_title('»'); endif;?><?php bloginfo('name'); ?></title>
8 <?php if( function_exists('get_the_keywords') ) :
9 $myKeywords = get_the_keywords('','',',',false);
10 ?>
11 <meta name="keywords" content="<?php echo $myKeywords; ?>" />
12 <?php endif; ?>
13 <?php if( is_home() ) :
14 // set static blog description on home page
15 $metadesc = $DEFAULT_DESC;
16 elseif (!empty($_REQUEST['s']) ) :
17 // results of a search so fabricate a good description
18 $metadesc = "Read articles about " .$_REQUEST['s']. " and find information related to " . $_REQUEST['s'];
19 elseif ( function_exists('get_the_description') ) :
20 // use modified Jerome's Plugin to get an intelligent description from
21 // custom keyword or the excerpt
22 $metadesc = get_the_description(false,$metadesc);
23 else: $metadesc='';
24 endif; ?>
25 <?php if( ! empty($metadesc) ): ?>
26 <meta name="description" content="<?php echo $metadesc; ?>" />
27 <?php endif; ?>

So whether you want to get as detailed as I have, or simply switch to using the Optimal Title plugin to make your titles more search engine-friendly, sooner or later you will need to consider how well your pages work for SEO if you care about your blog/website being found by your public.

Enjoy.


Link to this article! Copy & Paste code below into your page.

What Next?

RSS-Feed Subscribe to RSS-Feed
Subscribe via Email Subscribe via E-Mail
AddThis Social Bookmark Button

Add to Technorati Favorites

More from this category

Click here to watch The Conversion Blogging Video

Leave Comment

You must be logged in to post a comment.