Make WordPress SEO friendlier

Just a quick question…

If meta keywords were built for SEO friendly, why the default WordPress theme comes with no meta description and meta keyword?
WordPress default theme
Well, probably a lot of user added meta description and meta keywords themselves, but that’s all. It all fixed and not change-able. I recently look into the WP template tags, which has this get_the_tags function.

So I got into the default theme, add in this:

<meta name=”keywords” content=”
Check if it is on single.php
<?php if (is_single()){ ?>
If it’s on single.php, show the tags of the entry
<?php $posttags = get_the_tags();if ($posttags) {foreach($posttags as $tag) {echo $tag->name . ‘, ‘; }}?>
If not on single.php it shows these keywords.
<?php } else { ?>
My, own, fixed, keywords
<?php } ?>”
/>

Now you have different meta keywords on different entry, and the keyword is according to your post tags :)

If you like this articles, share it with your friend!

2 comments on Make WordPress SEO friendlier

  1. Dennis Lee
    February 5, 2010 at 10:19 am

    Cool tip… but too bad I didn’t use tags in the first place…

    Btw, I can’t see any label on your comment form. I’m just guessing which textbox to enter what.

    Reply
    • wong
      February 9, 2010 at 9:50 pm

      :lol: I learn that from GetSimple CMS actually…

      Ya, I accidentally deleted the Java :P

Leave a reply