Up until this point in the WordPress SEO series, I’ve been very confident in the power of the methods I’ve outlined. I really don’t believe a plugin should control your TITLE, I do believe you can increase search engine click-throughs by using the META description tag, and I do believe that Heading structure and hierarchy are important for keyword ranking.
But what I’m about to share today doesn’t have any solid metrics, and I’m not convinced it will help you at all. I do personally use this method on this blog, and I haven’t noticed any negative effects on my rankings, but there are some people who do believe that META Keywords should never be used, given their dark history.
So, implement this at your own risk. (By the way, Proximity News Theme users can turn this feature off in the theme options panel under the Search Engine Optimization section)
An Introduction to META Keywords
Back in the early days of the Internet and search engines, one of the ways a site’s administrator (webmaster for all you 90’s web guys) could boost his site’s rankings for certain keywords was to use the META Keywords tag in the HEAD of his HTML document. By doing this, he would be telling the search engine what kind of content was on that particular page.
But, some SEO guys figured out that you could game the system by stuffing keywords into the META Keywords tag that had very little, if anything, to do with the content of the website. The result was that you could do a search for something innocent, let’s say “gold jewelery” and end up on a page that was pornographic or ad-stuffed.
It was lazy SEO, and soon enough all the search engines wised up to it and de-prioritized the META Keyword value in ranking pages for keywords.
There are no hard facts as to how much priority they still place on the META Keywords value, if any at all. I’m inclined to believe that there is no penalty for using it in moderation, but the value is very low. I do not believe any of the search engines completely ignore the value, though, which is why I happen to use it here on my blog.
Keywords vs. Tags
In WordPress 2.3, the idea of “tagging” your content was introduced into the core of WordPress. You could now tag your content with certain keywords. You may notice that I do this at the bottom of nearly every post I publish here at the blog. I don’t do it because I believe it has massive value for SEO, but I do believe that it does affect your rankings, even if it is very small, especially in the blog search engines like Technorati.
In my opinion, there are no differences between tags and keywords.
I believe that tags and keywords are fundamentally the same thing, used for the same purpose — to tell something or someone, in a few short words, what the content of the website consists of.
Tags as Keywords
Since I’ve decided that I’ll be using my tags for the same purpose as META Keywords, I don’t see any reason not to use my tags AS my META Keywords.
So what we need to do is modify our header.php file and see if we can’t manage to use the tags we use to describe our posts as META Keywords in our page source. The only problem is, most tag “template tags” are meant to be used within the loop.
That’s actually not a problem if you did what I recommended in our META Description post, since we already have a loop occurrence in our header.php file. So, we’ll just piggyback on it. The code currently looks 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><meta name="description" content="<?php bloginfo('description'); ?>" /> <?php endif; ?>
So, what we need to do is insert our code right after the <meta name="description" ... />
code, but because I like to keep heavy coding out of the template files, let’s put first put the following code into our theme’s functions.php file somewhere between PHP tags:
function csv_tags() { $posttags = get_the_tags(); foreach((array)$posttags as $tag) { $csv_tags .= $tag->name . ','; } echo '<meta name="keywords" content="'.$csv_tags.'" />'; }
This code takes advantage of the get_the_tags function from WordPress which will return an array of the tags attached to the post. I’m using a foreach loop to get the tags into a comma separated list.
Then just insert the function call right under the META Description:
<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <meta name="description" content="<?php the_excerpt_rss(); ?>" /> <?php csv_tags(); ?> <?php endwhile; endif; elseif(is_home()) : ?> <meta name="description" content="<?php bloginfo('description'); ?>" /> <?php endif; ?>
That function will only generate the META Keywords tag and keywords if the post actually has tags attached to it. It also filters out static pages, which by default, do not have the ability to be tagged using the Write Page panel.
You could also set some keywords to describe your blog as a whole to be used when on the homepage by doing this:
<?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <meta name="description" content="<?php the_excerpt_rss(); ?>" /> <?php csv_tags(); ?> <?php endwhile; endif; elseif(is_home()) : ?> <meta name="description" content="<?php bloginfo('description'); ?>" /> <meta name="keywords" content="list,of,keywords,goes,here" /> <?php endif; ?>
I don’t personally do this, but you certainly could.
So, do what you please. If you think adding tags as keywords is a good idea for your blog or website, then by all means try it out! If it works, great! If not, you can always just remove the code and probably won’t be any worse off for trying.
What are your thoughts? I’m curious to know if anyone has any information on META Keywords that I’m unaware of. If I was mistaken in the post, I’d be happy to correct myself.
I don’t think the major search engines do use them, and I doubt they penalize you for using them, but that doesn’t stop me from using them just in case 🙂
Loving this SEO series. Whenever I get some free time I’m going to work my way through them all.
@Lee Munroe:
I’m the same way! 🙂 I think at least Yahoo still places some value on them, but you might be right about everyone else. Either way, it hasn’t hurt me, so I’ll keep using them.
I have just implemented that on my new theme, mostly because I happened to be doing the description at the same time. I also doubt it works, but if it doesn’t hurt…
@Andrew:
“…but if it doesn’t hurt…”
Exactly! 🙂
Thanks for explaining the concept of Meta Keyword in SEO of wordpress blog.
Hello
This is a very interesting and useful article. I will be implimenting this on my new blog to give me some good meta tags. I personaly think it will also help people who post to there blogs using windows live writer as they will be able to write there own meta tags from that program.
Very interesting article.
Thank You
Oh dear… I’m shocked to find out that I’m not the only one that thought of this. But posting about it, coding almost the same way… this is an amazing coincidence. No need to say that I really don’t know how I ended up on this page 🙂
Good to know I’m not alone in my thinking ! 🙂
Cheers !
Interesting article, i am not convinced that search engines worry to much about your meta tags, but you have covered the concept well.
Jason
I think if you’re going to tag your posts, this is a faster and more elegant way of doing it over using a plugin such as “all in one seo”. Knock both out at the same time.
That said, the “all in one seo” plugin has two unique advantages;
1. It allows you to set custom meta tags to pages (big plus since you can’t assign tags to them without using another plugin)
2. Since tags basically act as sub-categories, there are some posts that should include certain meta keywords yet don’t deserve to have their own tag/category.
For example; a post on a DIY site talking about wall anchors. “Wall anchors” should be a meta keyword but since the topic is so incredibly small, it doesn’t necessitate assigning a tag to it. Perhaps not the best example, but I think you follow the thought.
One more I just thought of is that meta keywords are a great place to sink long-tail phrases (whether you think they work or not) which wouldn’t make for a good tag at all.
Overall, I think the ability to define them separately is best for sites you place a lot of focus on. For other smaller sites, your code will work great.
Thanks for sharing.
hi…
I applied this in my code…
but if i view source of my wordpress…
I am not getting any meta tags foe keyword & description…
Can anybody help…
Thanks ..
Tweety
I understand that Google ignores them and Yahoo does not. Either way, as you said, it doesn’t hurt. Thanks for the code… beats copy and pasting.
Hi….
I want to add my customize description & keywords in my wordpress & I want to call them through my sql database…
Can anyone please help me out….
Thanks..
Tweety
Thank you very much for explaining this
This is really cool and exactly what I’ve been trying to do. Unfortunately, every time I try your instructions, The keywords just show up like “,”. I even tried setting it up as a plugin and got the same result. Do you have any idea why this may be happening? Thanks!
hello Nathan,
I have been reading along. Could you please tell me that in this post… if on the story page I use the tags as the keywords and keep a default static list for the caregory and home page … will that be fine for the SEO ?
I have 2 more questions on SEO but not relating to this post… could you please help on those ?
Good post, I always keen about keyword optimization.
thank you. I was always curious about whether the meta title should be the same.
Great post thanks I’ve been looking for something like this for ages
Thank you very much for very helpful WordPress SEO Series. It is the people like you, who makes the life easier for newbies like us.
Thank you again and again.:)
Hello
This is a very interesting and useful article. I will be implimenting this on my new blog to give me some good meta tags. I personaly think it will also help people who post to there blogs using windows live writer as they will be able to write there own meta tags from that program.
Very interesting article.
Thank You
but nathan i am not sure about this with pages, for pages i tried the same but have to use PJW Page Excerpt and Page Tagger plugins , the code seems to be working fine for meta description but does not call the tags
I have tried to grab my post tag as meta keyword using our function, unfortunately it doesn’t work…
I use wordpress 2.8.5, maybe it’s due to new features about tag in last version… no ?
Meta keywords do works with respect of own website and domain name.Choose words that may be secondary keyword terms (save the primary keywords for use in the and description tags), and even include a few, commonly seen typographical errors of primary keywords, just for good measure