• 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
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →

Stephanie Leary

Writer, WordPress consultant, recent MLIS grad

  • 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

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 © 2023 Stephanie Leary · Contact