Here’s another blog advice for you. If you are using All In One SEO pack plugin and are not able to add meta-keywords to category pages in WordPress, I am gonna teach you how to do that in this post. Some of you might argue that meta-keywords are obsolete things. Yes, it is said Google does not give a damn to them but we know Yahoo still uses meta-keywords for sure. Hence, if you want to rank better in Yahoo, you should consider adding meta-keywords to all the pages that you want to show up in Yahoo’s search results. Category Pages are very important pages from SEO point of view, so you need to make them perfectly search engine optimized and that’s exactly what we are going to learn in this post.
The default WordPress installation does not provide any support for adding meta-keywords to category pages without playing with the code. Yes, there are plugins to make life easy. However, the very popular All In One SEO pack plugin can only be used to add meta-keywords to posts and pages, but not to category pages and it is this shortcoming of All In One SEO pack that inspired me to write this post.
Plugins like HeadSpace2, SEO Title Tag plugin do provide an interface to add meta-keywords to category pages. So, if you have no SEO plugins installed, getting one of these two is a good idea if you want to do a complete optimization of your blog. But what if you are already using All in One SEO plugin?
The author of HeadSpace2 plugin says it lets you import data from All In One SEO pack. I tried doing the same, but a weird thing happened. All of the meta-keywords entered in All In One SEO pack got imported as tags. Thankfully, I try plugins locally on a dummy WordPress installation on my PC whenever possible before trying them on my blog. Hence no damage was done to my blog. After I could not use HeadSpace2 plugin, I decided to check out SEO Title Tag plugin, but after reading its documentation, I came to know that it does not support importing data from All In One SEO pack.
So I was left to either install HeadSpace2 plugin or SEO Title Tag plugin and import all data from All In One SEO pack manually or find something that would work with the All In One SEO pack. Luckily I found a code that would work with All In One SEO pack in a few minutes after I started playing with my theme files.
The code is not hard at all and is one line per every category. The code needs to be added to the header.php file of your theme near other codes used to generate other metadata. For example I added the code after the following line in the header.php file, used to generate the generator metadata:
1 | <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> |
The actual code to add the meta-keywords is the following:
1 | <?php if(is_category('XXXXXX')) { ?><meta content="metakeyword1, metakeyword2" name="keywords"><?php }?> |
where,
XXXXXX = the slug of the category to which you want to add meta keywords to.
metakeyword1, metakeyword2 need to be replaced with your actual keywords.
Add similar codes until you are done with all of your categories.
Note: If you want to add meta-description to category pages in WordPress while using All In One SEO pack plugin, you can do so easily by editing a category and writing a description for it. This description will be used by the All In One SEO pack plugin as meta-description for that category.
If you find it difficult incorporating my solution, post a comment and I would be happy to help you out.
Happy blogging with WordPress and All In One SEO pack plugin !


Thanks for your valuable suggestions for a beginner like me in SEO
Reply to this comment
Hello!
It works, but there are a problem at my site. If I have 4 categories. If I add the keywords to all of the categories it doesn’t works. The code use the same keywords for all the categories. What can be the problem?
Reply to this comment
LaMa, it is working fine at my blog. In my post, I have written, if you have multiple categories,
Did you do that?
I will tell you how to get it working if you have say 3 categories, cat1, cat2 and cat3. You need to add the following lines of code:
where, cat1, cat2, cat3 are the category slugs and not the names of the categories. Category slugs are different things than category names. If you have not manually edited your category slugs, your category slugs will be exactly like your categories’ name with hyphen replacing the space. For example, if you have got a category by the name “my favorite category”, its slug by default will be “my-favorite-category”. LaMa, check if you have done this correct. If you face further problems, post a comment again and I will help you until you are able to get this working.
Reply to this comment
Hi! Thank you for the answer. The site is on: mobilgarazs.net, I inserted the code:
And all of the categories has the same keywords: Kész garázs, kész garázsok, Készgarázs…
Everything is in the header php.
Reply to this comment
php if(is_category(‘mobil-garazs’)) { ?>
meta content=”Mobil garázs, Ponyvagarázs, Sátorgarázs, Kész garázs” name=”keywords”>
php if(is_category(‘kesz-garazs’)) { ?>
meta content=”Kész garázs, Kész garázsok, Készgarázs” name=”keywords”>
Reply to this comment
I have found out what was going wrong in your code. Actually it’s not your fault, the plugin that I used to format the code did some weird formatting of the code.
The thing inside is_category() should be inside single quotes and not inside the quotes generated by the plugin.
This should solve your problem.
And I need to thank you for finding this out, now I should start looking for some other plugin to format my code. Perhaps, you have a suggestion.
Reply to this comment
OK, it works! I changed the ‘ to ” in is_category(“category-name”). I’m using the default template from wp.
I added my category links to my sitemap. Can it be a content duplicating (from the Google site)?
Reply to this comment
Ok, soon I have the answer for it. If you insert the tag in your post, it can be seen only in the categori pages, and it isnt a content duplicating
Reply to this comment
I was looking the same info…
Thanx for sharing with us……..
Reply to this comment
Very nice and simple solution for WordPress. You’d think the folks from AllinOne SEO would implement something for the cats. Nice post.
Reply to this comment
Very simple solution, agreed it was the best method! Can’t wait to learn more everyone. Keep it up.
Reply to this comment
Hi,thanks for your valuable suggestion .I have used the code in my site http://www.assaminfo.in and it is working very well.
Reply to this comment
Hi, Thank u very Much 4 sharing this Information.
Reply to this comment
Awesome Site! Carry on the awesome job!
Reply to this comment