Feeds

Optimal Meta Description Tag Code For WordPress

PerformancingAds
Submitted by Ryan Caldwell on July 31, 2007 - 12:10pm in

When Andy Hagans says something, I listen. And Andy Hagans (following Aaron Wall) says that META descriptions are back and important, not for keyword stuffing, so much as page differentiation.

Did you know that the default for most WordPress themes is to NOT include a META description? While title tags remain, in my view, the single most important SEO factor, one of the biggest problems you'll face with any new-ish site is getting each page indexed. Google evaluates each page to see if it is important enough and different enough to separately indexed. If not, then you'll find many of your pages going supplemental.

So how does one go about differentiating her site? Well, title tags are a start. But they aren't enough. The on-page content should be at least 100 words. But sometimes that's not enough. So what else can you do to help GOOG differentiate your pages and see them as index worthy? Make sure that every page has a unique META description.

But as I said, most WordPress themes don't have META description code built in. That's where this post comes in. Below, I include the code for what I think of as two variations of an ideal WordPress META description.

<meta name="description" content="<?php if (is_home()) bloginfo('description'); else wp_title('',true); ?>"/>

In the above code, you are basing the description completely on the title of the page. That's a good start, and it may be the best option for complete differentiation, but in my view, a more complete solution would be something like the following addition

<meta name="description" content="<?php if (is_home()) bloginfo('description'); else {?>This page contains information about<?php wp_title('',true); ?>"/>

So what are your thoughts? What do you use to generate descriptions for your individual WordPress pages? If you're not into an automated soluton via code, what are some of the plugins that you use?


we use the head meta

we use the head meta description plugin

Meta Description

I dont use plugins.. hardcoded the header.php.. al sections should have something different.. arrange it with php: if, elseif, else.. is_search / is_page / is_single / is_archive / is_category / is_home .. so many options available..

Regards

Yeah, the meta head plugin

Yeah, the meta head plugin sorts this out automatically, although it limits the description to 20 words. You can tweak this fairly easily to about 25 words, which gives you a bit more scope.

At the risk of self-promotion, I wrote a port of the head meta code to ASP.NET and I use it when developing .NET web apps. Could be useful for anyone who's rolled their own blog platform on .NET.

Custom fields and PHP

I know nothing about PHP.

But with custom fields and cobbling some PHP together, I've managed to get unique meta description and keywords on my home page and on each post.

Using custom fields gives you far more control than just repeating the title or whatever.

I'm trying to write some nested if statements to check whether it's a category page or a tag page as well. But I keep getting it wrong and putting too many squiggly and pointy brackets in ...

How to make this in blogger

How to do this thing in blogger?

How to make this in blogger

I have a blog --> http://orkut-guide.blogspot.com/

but individual meta tags are not showing up. what to do?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <img> <div> <a> <em> <strong> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <span> <table> <td> <tr> <caption> <th> <hr> <pre> <br> <p> <object> <param> <embed> <strike>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
14 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.