Columbus, Ohio SEO Expert | Jacob Stoops

SEO-Friendly META Description Tag for WordPress

Post Comments
0 Comments

In this article, I will explain how to make your WordPress META Description more SEO-friendly using WordPress Conditional Tags. If you followed my last post, I spoke about Optimizing Your WordPress Title Tags to make them more search-friendly. Basically, you should be able to use both for a fairly effective optimization of your WordPress blog (without having to use any plugins).

SEO-Friendly META Description Tag for WordPress

WordPress & META Tags

As you all know, WordPress does not include META Tags by default. It is up to each user to add their own META Tags. If used correctly, a META Description tag can be a very valuable SEO tool. However, in WordPress, if you do decide you need a META Description tag, it will usually have to be placed in the ‘header.php’ file within the<head></head> tags.

SEO-Friendly META Description Tag for WordPress

The thing about WordPress and the ‘header.php’ file is that the same header file and same META info shows up on every single page (because it’s a PHP include). For design, this is very easy and makes a ton of sense. For search engine optimization, it isn’t a very good solution.

Why Isn’t a Single META Description Good Enough?

Why isn’t it a good solution, you ask? For SEO, it is optimal to have a unique Title Tag & META Description for every single page of your site/blog. If you just plug in your META Description as is, it will be duplicated across ever page of your site. This means that the same META Description will be indexed for every page of your site, regardless of whether or not it has to do with each page’s content or not.

META Descriptions are probably the most important META Tag you can utilize for SEO. They are generally pulled by search engines and displayed directly underneath your listing in the SERPs, making them a super premium place to have good keywords.

Creating SEO-Friendly META Descriptions for WordPress

In order to ensure that each page of your site gets the attention that it should, you’re gonna to use a different META Description for each page of your site (rather than 1 general one across the whole site).

How Can I Optimize My META Description?

I’m glad you asked! Finally, we’ll get to those Conditional WordPress Tags I talked about earlier. Here is the code below:

<meta name=”description” content=”<?php if (have_posts() && is_single() OR is_page()):while(have_posts()):the_post();
$out_excerpt = str_replace(array(“\r\n”, “\r”, “\n”), “”, get_the_excerpt());
echo apply_filters(‘the_excerpt_rss’, $out_excerpt);
endwhile;
elseif(is_category() OR is_tag()):
if(is_category()):
echo “Posts related to Category:
“.ucfirst(single_cat_title(“”, FALSE));
elseif(is_tag()):
echo “Posts related to Tag:
“.ucfirst(single_tag_title(“”, FALSE));
endif;
else: ?><?php bloginfo(‘description’) ?>
<?php endif; ?>” />

Install this code in between your WordPress site’s <head></head> section in the ‘header.php’ file. Basically, this code will do a couple things.

  1. If the search engine/user views your site’s individual pages or categories, the conditional WordPress tags kick in and tell the browser/webcrawler to grab the opening excerpt of your post/page and use that as the META Description tag.
  2. If the search engine/user lands on the homepage, it will tell the browser/webcrawler to display the default Blog Description (which you specify on the ‘Settings’ page) as your META Description.

Anything Else?

Yes there is. Using this code is a great way to get the focus on your site’s content rather than always defaulting to one single description. However, there are a couple of things you must remember to do:

  1. Make sure that valuable keywords are included early on each page, preferably within the 1st two sentences. This will help ensure that those valuable keywords get picked up in search engines, and hopefully pulled for whatever keyphrase you’re targeting.
  2. Make sure that the content in your post /page works in conjuction with your post/page title and doesn’t contradict it. This will help solidify your post/page’s reputation with the search engines.

Hope this tutorial helps!

GD Star Rating
loading...

This entry was posted in Wordpress and tagged , , , . Bookmark the permalink.

Jacob Stoops

About the Author

is an SEO professional living in Columbus, Ohio and working for Rosetta Marketing. He's been working in the SEO industry since 2006, and has been blogging since 2009. Learn more about , a Columbus, Ohio SEO Expert.

Comments & Social Reactions

  • http://skateboard-part.co.cc jawir

    Very good information. Thank you

    GD Star Rating
    loading...
  • http://www.marketingweb.com.au Web Marketing

    This is a good solution compared to the standard wordpress install, but not as good in my opinion as putting in an individually crafted meta description tag for each. This can be achieved via a number of WordPress SEO plugins. However that said your solution would also be good for those that forget these types of things. Do you have any idea if this will work in conjunction with WordPress SEO plugins?

    GD Star Rating
    loading...
    • jacobstoops

      I agree that plugins make it much easier to give each page a unique Meta Description, which each page should have. However, if you're running a WordPress blog and aren't utilizing any plugins, then this is better then the default solution.

      GD Star Rating
      loading...
  • Lou Sparx

    Broke my blog. My fault as I should have checked the date of the article.

    GD Star Rating
    loading...
    • jacobstoops

      Very sorry. This script worked on my much older version of WP (maybe 2.0?), but may not be compatible with newer versions of WP, and there are many SEO-friendly plugins that can take care of this for us now – such as the All-In-One SEO Pack.

      GD Star Rating
      loading...
  • business cards sydney

    Nice coding for Meta Tags.

    GD Star Rating
    loading...
My Work
Agent SEO Portfolio | Ohio SEO

Connect with Me

2416 Subscribers & Followers
  • Subscribe to the Agent SEO RSS Feed
  • Follow Jacob Stoops on Twitter
  • Follow Jacob Stoops on Facebook