• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • Presentations and Interviews
    • on GitHub →
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • WordPress Plugins

Stephanie Leary

Writer, Front End Developer, former WordPress consultant

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

Using categories and tags as meta keywords

August 15, 2009 Stephanie Leary Leave a Comment

Your categories and keywords are valuable bits of metadata, but WordPress doesn’t use them in its meta tags. Even the popular All in One SEO Pack plugin uses only categories, not tags.

To use both, add this to the head section of your theme:

  foreach((get_the_tags()) as $tag) {
    $keywords[] = strtolower($tag->name);
  }
  foreach((get_the_category()) as $category) {
    $keywords[] = strtolower($category->cat_name);
  }
?>
" />

The last line removes duplicates and joins the keywords with a comma — just the way search engines like them.

WordPress categories, keywords, Metadata, tags, template tags, Templates

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Reader Interactions

Leave a Reply Cancel reply

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

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2025 Stephanie Leary · Contact