Facebook Twitter Gplus YouTube RSS
Home Guides - How to Wordpress WordPress SEO Guide
formats

WordPress SEO Guide

Published on March 11, 2010 by in Wordpress

Using META Keywords:

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; ?>

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.

 
Pages: 1 2 3 4 5 6 7 8 9 10 11

 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2012 Finns-projects.com. All rights reserved.
credit