How to Exclude a Blog Category from Displaying
For example, because there is already a separate list of videos on the homepage at RosalindGardner.com, I didn’t want the videos to show up again in the “Most recent entry posted” featured at the top of the page.
So, to eliminate the Videos category from that section, I first look go to Manage > Categories in my Wordpress Administration panel and look for the category ID, which turns out to be #10.
I open the home.php template (you might be using index.php) and add cat=-10 to the code for the most recent post as follows:
< ?php $recent = new WP_Query("showposts=1&cat=-10"); while($recent->have_posts()) : $recent->the_post();?>
Note the minus sign in front of the category number.
If you want to eliminate more than one category from the display, simply separate each category ID number with a comma, such as: &cat=-10,-22 .
[tags]blog, wordpress, category, exclusions[/tags]
Want more info?
Rosalind Gardner is a Super Affiliate blogger, author, speaker, and Internet marketing consultant.
If you enjoyed this article and want to be notified the next time Rosalind writes something, subscribe to her RSS feed or the No-Hype, No-BS, No Spam NPT newsletter. You can also follow her on Twitter and Facebook. Thanks for visiting!
Related Posts
- Create a Unique Site Map for Your Wordpress Blog
- Just Added the Simple Recent Comments Plugin
- Clickbank Marketplace Category Refinements
- Technorati Tagging Made Simple
- Is Your Blog Featured On Facebook?




Dear Rosalind, First I hope yopu are on the mend and getting over your traumatic surgery. Good Luck.xxx
Second is that I have liked all the good things coming my way from you, but am surprised to see and unfortunately buy (£39.99) the programme on your blogsite.
Namely “How I earn £14,246 a week”. This is a con for hard up pensioners like me. It’s a Gambling programme primarily, and betting against a Roulette Wheel and Football results. A Game of chance which I am sure will loose a lot of money if you followed it. I think he is also reselling with no Rights. I have asked for a refund.
Thought you might like to know and perhaps check him out.
Regards Michael Chalke.