Add descriptions to category pages in WordPress to inject relevant keywords
I optimize my category pages (the pages that show excerpts of all the posts in the category) for certain keywords and I think all bloggers should do the same. Now to optimize the category pages for certain keywords, adding descriptions at the top of the category pages that contain relevant keywords would do some help. The description will always stay on top of the category page and have the keywords that you are targeting and thus would help in SEO. In this post I’ll tell you how to add descriptions at the top of category pages in WordPress.
Here are two important things that I would like to discuss before I get to the code:
1) Certain themes allow for the description that you enter as Category Description from the Edit -> Category page of the WP Control panel to be displayed on top of respective category pages. All themes don’t provide this functionality. Mine does not. If you have a theme with this functionality, chances are you are already displaying descriptions on your category pages.
2) If you are using All In One SEO pack plugin, the plugin inserts the category description that you enter from the WP Control Panel (from Edit -> Category) as meta description tags for the respective category pages. This is a great functionality provided by this plugin and I urge everyone to use this feature. But if you are using a theme that displays category descriptions in category pages (as explained in point 1), you end up with a description that is exactly the same as the meta description tag for that page. What if you want longer descriptions to show on top of the category pages and short meta descriptions?
So the thing is even if your theme has the functionality that I discussed earlier I urge you to use the code that I will give you in a while so that you can insert a relatively large description packed with the keywords that your are targeting. By packed I mean that accommodates all the keywords that you are targeting and not keyword spamming.
Here’s the code:
1 | <?php if(is_category('category-name')) { ?>Category-Description<?php } ?> |
where, category-name should be replaced by the category slug and Category-Description should be replaced by the actual category description.
You need to add this code to the archive.php file of your theme. You can wrap the code inside a div so that you can apply CSS rules to it. You need to add similar codes until you are done with all of your categories.
That’s it and now your category pages will become more optimized for the keywords you are targeting.

But what if I don’t have archive.php in my theme files?
The same code should work with your theme files as well. You just need to figure out where do you want to display the description and find the right place in one of the theme files to put the code.
Hey thanks – I knew that would be important – I’d like to trade incoming links to those categories!
My theme is using slightly different format for the PHP:
Archive for the ” Category
Should I write it in as you have it, or as
Thanks much – your idea is right on!!
I can’t figure out what you are actually trying to ask, but I suppose you are trying to say something about the naming of the files in your theme. My theme also has a archive.php file and I have put the above code in it and it’s running and performing. I suppose the above code should work no matter how your theme files are named because the code uses a native WP function and should work in any theme.
Neil, I would love to hear from you again about your problem. Please correct me if I misunderstood you and you were asking something else.
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language
See you!
Your, Raiul Baztepo
Hi !!!!
I am Piter Kokoniz. oOnly want to tell, that I like your blog very much!
And want to ask you: is this blog your hobby?
Sorry for my bad english:)
Thank you!
Your Piter Kokoniz, from Latvia