Ultimate Guide to WordPress SEO – META Descriptions

One of the tricks to WordPress SEO is understanding that it’s not all about rankings.  Sure, high rankings for your target keywords are awesome, and they definitely produce great returns, but lower rankings aren’t bad all the time either. If we think about a search engine results page (SERP) as a billboard for our content, then sure, position matters, but so does the content of our billboard.

And that’s exactly what we can do using the META description tag.  We can actually control what gets displayed in our little spot of SERP real estate, therefore utilizing a tremendous opportunity to convert that space into traffic.

Have you ever been linked to from another blog? Don’t you sometimes wish you could have had some say as to what was said in the blog post that linked to you?  It’s the same concept with using the META description to control the content that describes the page in a SERP.

Anatomy of a Search Engine Results Page

Search Engines, like Google, tend to display search results in a very standard format.  Usually the TITLE of the post or page is the link that actually takes you to the post, and under that link is a description of the site linked to.  Under that, you usually find the URL of the page as well.  Here is an image that illustrates my point:

We Can Manipulate All Three Parts

What most people fail to realize is:

  1. Each one of these places can be manipulated by YOU!
  2. Failing to manually manipulate them means you aren’t taking advantage of free ad space from the search engine!

Because search engines are the primary traffic source for most good websites (websites that have good SEO, at least), we can’t undervalue potential clicks to our content.  If people just scan past our page on the SERP, then we wasted our time getting it ranked! You need to pull them in! And the way you so that is by manipulating the content of your result in the SERP.

How To Manipulate Our Result Listing

Since there are three parts to every result listing, there are three parts that we need to manipulate.  Fortunately for you, I’ve already taught you how to manipulate the TITLE and the URL in this series.  In order to manipulate what the title looks like, you need to optimize your TITLE tag.  And in order to manipulate the URL, you need to be sure you’re optimizing your permalinks.

But, here’s how you change what the result page uses as the description for your content.

Essentially, you’re going to want to be ranking for three types of content — your homepage, your single posts, and your static pages.  So, we need to determine what the best strategy for displaying the most accurate, relevant description for our content within the META tag, which looks something like this:

<meta name="description" content="The Description of your content" />

This tag should go somewhere between the <head></head> tags in the header.php file of your WordPress theme.  But out dilemma is, how do we populate the “content” section of the META description dynamically based on what content we’re viewing?  Simple — we use a combination of conditional tags and a custom loop to pull either the sites tagline (if we’re on the homepage) or the excerpt (if we’re in a single post or static page).

The final result will look something like this:

<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<meta name="description" content="<?php the_excerpt_rss(); ?>" />
<?php endwhile; endif; elseif(is_home()) : ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>

In plain English: if we are viewing a single post or static page, then use the_excerpt_rss as the description for that post or page.  The reason we use the_excerpt_rss is because it strips out all formatting tags, something that isn’t useful when not displaying the text. But, if we are on the homepage, then we need to use the blog’s tagline (the bloginfo(‘description’) outputs the tagline of the blog).

So, by displaying this META description both conditionally and dynamically, we have way more control over what the search engine results page displays as the description of our homepage, static pages, and single posts.

Even More Control

Usually, most bloggers don’t take advantage of the use of the “optional excerpt” section of their Write Post panel.  But if you want to exercise even more control over what gets displayed on the SERP for content, then you need to be filling this section out.  If it’s blank, your post description will just be the first X amount of words in your post.  But sometimes those words don’t do a very good job of selling your content.  In this instance, do something like this:

Now that I have an optional excerpt filled in for that post, let’s see how that post looks on a Search Engine Results Page:

Perfection!

So, now you know how I use search engines to generate the majority of my traffic.  I don’t use the optional excerpt all the time — not by a long shot.  But whenever I feel like the post needs a good desctiption, and the first few words just don’t cut it, using this method is absolutely perfect!

Check back next time to see how we use a very similar method to generate META keywords for our content.

Comments

  1. Nathan Rice says

    @Ian Stewart:

    That’s certainly possible, but in my experience, Google does a good job of truncating it. I’m not aware of any penalties for using a META description longer than X number of words.

  2. Iva says

    Hey Nathan, than you so much for this series of articles.

    Now, that you and Ian Stewart have mentioned description truncation…

    I’m having a strange problem with my WordPress-powered site’s listing and now, having seen that such a thing was not mentioned in your article, I thought I’d ask and I do hope you have an idea of what this could be: my meta tags are appropriate, my settings are appropriate, the most of my basic SEO is appropriate. However, Google is indexing my description incorrectly, with the site starting date before the actual text.

    This is what I mean. My site is the third one in the list and its description begins with something that is not included in the meta tag (24 Nov 2004). The date is the site’s launch date and that’s what makes it even more confusing. How can I change this listing for the description to look the way I intended it to be?!

    My site validates as XHTML 1.0 transitional, so it definitely isn’t a case of broken XHTML.

    I’d appreciate any help on this.

  3. Justin Tadlock says

    the_excerpt_rss()! I completely forgot about that. I’m doing something similar in one of my themes and had been stripping it with even more code.

    I’m really enjoying the series, so keep the posts coming.

  4. Nathan Rice says

    @Iva:

    I’d check out how often Google is indexing your homepage using the webmaster tools. I can’t find “Nov 24″ anywhere in your source, so it makes me thing that Google hasn’t indexed/crawled your homepage in a very long time.

  5. Nathan Rice says

    @Justin Tadlock:
    Yeah, I did that at first too. I think I discovered that at the bottom of the the_excerpt Codex page under the “Related” section. Dumb luck probably. :-)

  6. Iva says

    Thank you. I have checked it all and the last crawl was on 07th October; while this phantom date has been around for at least a year and I cannot get rid of it. As this is apparently (and thankfully) not WordPress-related, I have asked in Google webmaster help.

  7. Leland says

    Hey Nathan. First of all, awesome series of posts.

    Wow, I’d have never thought of using the excerpt code as a description. I’ve been using the All In One SEO Pack plugin to modify meta descriptions.

    I guess it depends on your personal preference: whether you want to be dependent on a plugin (that may or may not be compatible with future versions of WP) or simply build it into your theme.

  8. Jens says

    Thanks for a great article series!

    What about archive pages? Is it safe to assume that if we exclude archives (like in your previously mentioned advice) we don’t need to take care of meta descriptions on those?

  9. Nathan Rice says

    @Jens:
    Yes, that is correct. If you’ve told Google not to index those archives, then having meta descriptions for them would be pointless.

    A very astute observation!

  10. matt says

    I’m using contact form 7 on my wordpress blog and it inserts a meta description based on what i enter in the posting panel. however, i also have a meta description hard-coded into my template that is a general one for my website. Does google frown on having multiple meta descriptions? If so, in your opinion, what is more important a description of the actual post or a description of the blog?

  11. Nathan Rice says

    @matt:
    I doubt they frown on it, but it will be confusing for Google. Remember, Google is a machine, so it can’t do much logic on its own. Having only 1 META description will give it clear instructions for what to use as the description.

  12. John H. Gohde says

    I have been reading all of your posts on your SEO tutorial with great interest.

    I did your meta descriptions one better, by adding meta descriptions to my blog tag pages in hopes of making them more unique. The same descriptions are also visible on the tag pages themselves by use of the functions.php template for my theme.

    While I do use plugins, I have always been interested in modifying my theme templates.

  13. Josh Stauffer says

    Hi Nathan,

    Thank you for this post. I have bookmarked this page. :-)

    I tried using the_excerpt_rss() in my header.php to no avail. Does this function work outside of the loop?

    Thanks in advance for your response!

  14. Dorian says

    Thanks for posting this. I tried using the_excerpt and ran into the formatting issues… using the rss excerpt is a great idea.

    I’ll be back soon to read the rest of your wordpress seo articles.

  15. M. Boothe says

    Thank you for explaining this in terms that a user can understand. You say, “if we are viewing a single post or static page, then use the_excerpt_rss as the description for that post or page.”

    Is there a way to customize what is excerpted from a static page?

  16. Bob says

    Hi Nathan

    Some great tips in here, I’m glad I found you.(Not hard, you do good SEO).

    I’m new to blogging, started January. I recently hit problems which is why I am here, looking for answers.I have made just over 30 posts so far. The first 27 posts are all still coming up in Google for a search on the title. Most come up on page one and the rest on page two. My most recent 6 articles all appear on page one within 8 hours or so, yesterdays post took only 40 mins to get 5th. But within 2 or 3 days they disappear completely, as in de-indexed.

    I recently started filling in the fields of All in One SEO plugin and I’m sure that’s caused the problem. Are there some things you can do wrong so that Google thinks you are spammy? I suspect my description which was similar on all pages and was using some keywords not in the body of the articles, may be the problem. Is it also a case that the excerpt must appear in the body exactly for it to count? I have now deleted all the information from those fields to try and “start fresh”.

    Can you give me any advice?

    Cheers

    Bob

  17. malcolm coles says

    Bob – that always happens to me, and I don’t use AIOSEO. I read somewhere that google has two(+) indexes, and it shoves the posts in the first one when it first finds the URL (often without a cache view). Then when it finds out a bit more about the page (ie crawls it properly), it puts it in the main index. There’s usually a gap in between (so that the URL doesn’t appear twice), which makes it look like your page has disappeared.

  18. Bob says

    Malcolm
    When I first read what you said, it didn’t make sense. Frankly, I thought you were nuts! Now I’m not so sure. I’m monitoring my posts. Strange things are happening. You may be right.

    Anyone else got a view?

  19. Bob says

    Malcolm: I am not alone! That is exactly what is happening to me. Thank you for the link. I have just had two of my disappeared results reappear at first and 16th after about a week missing. So I think calling you nuts was a bit harsh. Only two of my articles remain missing. I too now believe in be minty fresh and the standard Google search results theory. Thanks for your help.

  20. Mike S. says

    Can I just say that I have been looking for this information for a few days….. thank you SO much. This really is great series!

  21. New Orleans Singles says

    Thank you so much! The theme I’m using on my New Orleans Singles and Dating site (linked on my comment name) did not have a description tag in the head. wtf!?! So, when I see my site come up in search results, the description was junk it pulled from whatever page it was indexing. I added your code and can’t wait to see how nice my results will look once Google updates! Thanks so much.

  22. Hakon says

    Hi,

    Thanks for a great article!

    But one question:

    What is the difference between ‘the_excerpt’ and ‘the_excerpt_rss’ ?

  23. Jim Stephens says

    Nathan,

    Your articles are really helpful. I have a question about this particular meta description code. When I insert it into my header.php it leaves the actually description on the top of my page for some reason. any clue why? I’m using WP 2.8.4. I’d really like to be able to make use of this, but without it actually showing up on the top of each post.